Files
pkgsrc-ng/net/xorp/patches/patch-ac
2013-09-26 17:14:40 +02:00

40 lines
1.4 KiB
Plaintext

$NetBSD: patch-ac,v 1.5 2009/05/12 13:58:44 obache Exp $
--- fea/data_plane/ifconfig/ifconfig_get_ioctl.cc.orig 2009-01-05 18:30:53.000000000 +0000
+++ fea/data_plane/ifconfig/ifconfig_get_ioctl.cc
@@ -159,7 +159,7 @@ IfConfigGetIoctl::read_config(IfTree& if
return (XORP_ERROR);
vector<uint8_t> buffer(ifconf.ifc_len);
memcpy(&buffer[0], ifconf.ifc_buf, ifconf.ifc_len);
- delete[] ifconf.ifc_buf;
+ free(ifconf.ifc_buf);
parse_buffer_ioctl(ifconfig(), iftree, AF_INET, buffer);
}
@@ -173,7 +173,7 @@ IfConfigGetIoctl::read_config(IfTree& if
return (XORP_ERROR);
vector<uint8_t> buffer(ifconf.ifc_len);
memcpy(&buffer[0], ifconf.ifc_buf, ifconf.ifc_len);
- delete[] ifconf.ifc_buf;
+ free(ifconf.ifc_buf);
parse_buffer_ioctl(ifconfig(), iftree, AF_INET6, buffer);
}
@@ -209,13 +209,13 @@ ioctl_read_ifconf(int family, ifconf *if
for ( ; ; ) {
ifconf->ifc_len = ifnum * sizeof(struct ifreq);
if (ifconf->ifc_buf != NULL)
- delete[] ifconf->ifc_buf;
- ifconf->ifc_buf = new char[ifconf->ifc_len];
+ free(ifconf->ifc_buf);
+ ifconf->ifc_buf = (char *)malloc(ifconf->ifc_len);
if (ioctl(s, SIOCGIFCONF, ifconf) < 0) {
// Check UNPv1, 2e, pp 435 for an explanation why we need this
if ((errno != EINVAL) || (lastlen != 0)) {
XLOG_ERROR("ioctl(SIOCGIFCONF) failed: %s", strerror(errno));
- delete[] ifconf->ifc_buf;
+ free(ifconf->ifc_buf);
comm_close(s);
return false;
}