aboutsummaryrefslogtreecommitdiff
path: root/net/libnet
diff options
context:
space:
mode:
authorSunpoet Po-Chuan Hsieh <sunpoet@FreeBSD.org>2015-01-18 10:36:16 +0000
committerSunpoet Po-Chuan Hsieh <sunpoet@FreeBSD.org>2015-01-18 10:36:16 +0000
commit8ed03fb8dbd1b168f64eb5e9ffc846c160285273 (patch)
tree3b5851fbac8fff237005b7dda4f862a5c2efae04 /net/libnet
parent544858383813139db6206ec199d8ada4bbb1b3e1 (diff)
downloadports-8ed03fb8dbd1b168f64eb5e9ffc846c160285273.tar.gz
ports-8ed03fb8dbd1b168f64eb5e9ffc846c160285273.zip
- Backport upstream fixes (from 1.2 to 1.1.6)
Notes
Notes: svn path=/head/; revision=377316
Diffstat (limited to 'net/libnet')
-rw-r--r--net/libnet/Makefile2
-rw-r--r--net/libnet/files/patch-include-libnet.h.in (renamed from net/libnet/files/patch-libnet.h.in)0
-rw-r--r--net/libnet/files/patch-src-libnet_cq.c15
-rw-r--r--net/libnet/files/patch-src-libnet_if_addr.c34
-rw-r--r--net/libnet/files/patch-src-libnet_link_bpf.c32
5 files changed, 82 insertions, 1 deletions
diff --git a/net/libnet/Makefile b/net/libnet/Makefile
index ab769e385260..ed0be52a87e8 100644
--- a/net/libnet/Makefile
+++ b/net/libnet/Makefile
@@ -3,7 +3,7 @@
PORTNAME= libnet
PORTVERSION= 1.1.6
-PORTREVISION= 2
+PORTREVISION= 3
PORTEPOCH= 1
CATEGORIES= net
MASTER_SITES= SF/libnet-dev
diff --git a/net/libnet/files/patch-libnet.h.in b/net/libnet/files/patch-include-libnet.h.in
index 1f5e6f390bd6..1f5e6f390bd6 100644
--- a/net/libnet/files/patch-libnet.h.in
+++ b/net/libnet/files/patch-include-libnet.h.in
diff --git a/net/libnet/files/patch-src-libnet_cq.c b/net/libnet/files/patch-src-libnet_cq.c
new file mode 100644
index 000000000000..e0177d8fefd2
--- /dev/null
+++ b/net/libnet/files/patch-src-libnet_cq.c
@@ -0,0 +1,15 @@
+- Reset global cq state after destroying it.
+
+Obtained from: https://github.com/sam-github/libnet/commit/c9390bf8f3379c280ba8ceec67fbd8e908675d96
+
+--- src/libnet_cq.c.orig 2012-03-20 00:59:50.000000000 +0800
++++ src/libnet_cq.c 2015-01-18 03:09:08.170403000 +0800
+@@ -344,6 +344,8 @@
+ libnet_destroy(tmp->context);
+ free(tmp);
+ }
++ l_cq = NULL;
++ memset(&l_cqd, 0, sizeof(l_cqd));
+ }
+
+ libnet_t *
diff --git a/net/libnet/files/patch-src-libnet_if_addr.c b/net/libnet/files/patch-src-libnet_if_addr.c
new file mode 100644
index 000000000000..d0b9a1e7d3dc
--- /dev/null
+++ b/net/libnet/files/patch-src-libnet_if_addr.c
@@ -0,0 +1,34 @@
+- memory leak fixed, device list needs to freed after use. [2]
+- Properly set l->err_buf if libnet_ifaddrlist() fails. [3]
+
+Obtained from: https://github.com/sam-github/libnet/commit/18cbe497dd84afc471a5320e4ef3a7cde87c2c4e [1]
+ https://github.com/sam-github/libnet/commit/2e724b2f5cd614d7362f8dcbc57dc1fca6e437b3 [2]
+
+--- src/libnet_if_addr.c.orig 2012-03-20 00:59:50.000000000 +0800
++++ src/libnet_if_addr.c 2015-01-18 03:09:08.169400000 +0800
+@@ -330,6 +330,8 @@
+ ++nipaddr;
+ }
+
++ pcap_freealldevs(alldevs);
++
+ *ipaddrp = ifaddrlist;
+ return (nipaddr);
+ }
+@@ -339,7 +341,6 @@
+ libnet_select_device(libnet_t *l)
+ {
+ int c, i;
+- char err_buf[LIBNET_ERRBUF_SIZE];
+ struct libnet_ifaddr_list *address_list, *al;
+ uint32_t addr;
+
+@@ -364,7 +365,7 @@
+ /*
+ * Number of interfaces.
+ */
+- c = libnet_ifaddrlist(&address_list, l->device, err_buf);
++ c = libnet_ifaddrlist(&address_list, l->device, l->err_buf);
+ if (c < 0)
+ {
+ /* err msg set in libnet_ifaddrlist() */
diff --git a/net/libnet/files/patch-src-libnet_link_bpf.c b/net/libnet/files/patch-src-libnet_link_bpf.c
new file mode 100644
index 000000000000..6d0dfefce319
--- /dev/null
+++ b/net/libnet/files/patch-src-libnet_link_bpf.c
@@ -0,0 +1,32 @@
+- Make libnet_get_hwaddr() work with 802.1q interfaces in bpf (BSD).
+
+Obtained from: https://github.com/sam-github/libnet/commit/408fa2266a4af402152cc0f1e9a40b56477b995a
+
+--- src/libnet_link_bpf.c.orig 2012-03-20 00:59:50.000000000 +0800
++++ src/libnet_link_bpf.c 2015-01-18 03:09:08.169400000 +0800
+@@ -316,7 +316,11 @@
+ if (ifm->ifm_type == RTM_IFINFO)
+ {
+ sdl = (struct sockaddr_dl *)(ifm + 1);
+- if (sdl->sdl_type != IFT_ETHER)
++ if (sdl->sdl_type != IFT_ETHER
++ && sdl->sdl_type != IFT_FASTETHER
++ && sdl->sdl_type != IFT_FASTETHERFX
++ && sdl->sdl_type != IFT_GIGABITETHERNET
++ && sdl->sdl_type != IFT_L2VLAN)
+ continue;
+ if (strncmp(&sdl->sdl_data[0], l->device, sdl->sdl_nlen) == 0)
+ {
+@@ -326,6 +330,12 @@
+ }
+ }
+ free(buf);
++ if (next == end) {
++ snprintf(l->err_buf, LIBNET_ERRBUF_SIZE,
++ "%s(): interface %s of known type not found.",
++ __func__, l->device);
++ return NULL;
++ }
+ return (&ea);
+ }
+