Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 18 Jan 2015 10:36:17 +0000 (UTC)
From:      Sunpoet Po-Chuan Hsieh <sunpoet@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r377316 - in head/net/libnet: . files
Message-ID:  <201501181036.t0IAaHEO049489@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: sunpoet
Date: Sun Jan 18 10:36:16 2015
New Revision: 377316
URL: https://svnweb.freebsd.org/changeset/ports/377316
QAT: https://qat.redports.org/buildarchive/r377316/

Log:
  - Backport upstream fixes (from 1.2 to 1.1.6)
  - Bump PORTREVISION for package change
  - While I'm here, rename patch-libnet.h.in to patch-include-libnet.h.in
  
  PR:		196818
  Submitted by:	Kevin Hung <khung@nullaxiom.com> (via email)
  Obtained from:	https://github.com/sam-github/libnet/commit/18cbe497dd84afc471a5320e4ef3a7cde87c2c4e
  		https://github.com/sam-github/libnet/commit/2e724b2f5cd614d7362f8dcbc57dc1fca6e437b3
  		https://github.com/sam-github/libnet/commit/408fa2266a4af402152cc0f1e9a40b56477b995a
  		https://github.com/sam-github/libnet/commit/c9390bf8f3379c280ba8ceec67fbd8e908675d96

Added:
  head/net/libnet/files/patch-include-libnet.h.in
     - copied unchanged from r377266, head/net/libnet/files/patch-libnet.h.in
  head/net/libnet/files/patch-src-libnet_cq.c   (contents, props changed)
  head/net/libnet/files/patch-src-libnet_if_addr.c   (contents, props changed)
  head/net/libnet/files/patch-src-libnet_link_bpf.c   (contents, props changed)
Deleted:
  head/net/libnet/files/patch-libnet.h.in
Modified:
  head/net/libnet/Makefile

Modified: head/net/libnet/Makefile
==============================================================================
--- head/net/libnet/Makefile	Sun Jan 18 10:36:11 2015	(r377315)
+++ head/net/libnet/Makefile	Sun Jan 18 10:36:16 2015	(r377316)
@@ -3,7 +3,7 @@
 
 PORTNAME=	libnet
 PORTVERSION=	1.1.6
-PORTREVISION=	2
+PORTREVISION=	3
 PORTEPOCH=	1
 CATEGORIES=	net
 MASTER_SITES=	SF/libnet-dev

Copied: head/net/libnet/files/patch-include-libnet.h.in (from r377266, head/net/libnet/files/patch-libnet.h.in)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/net/libnet/files/patch-include-libnet.h.in	Sun Jan 18 10:36:16 2015	(r377316, copy of r377266, head/net/libnet/files/patch-libnet.h.in)
@@ -0,0 +1,12 @@
+--- include/libnet.h.in.orig	2012-03-06 01:45:46.000000000 +0100
++++ include/libnet.h.in
+@@ -81,6 +81,9 @@
+ #if !defined(__WIN32__)
+ # include <sys/socket.h>
+ # include <net/if.h>
++# if defined (__FreeBSD__) || defined (__DragonFly__)
++#  include <netinet/in.h>
++# endif
+ #else /* __WIN32__ */
+ # if (__CYGWIN__)
+ #  include <sys/socket.h>

Added: head/net/libnet/files/patch-src-libnet_cq.c
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/net/libnet/files/patch-src-libnet_cq.c	Sun Jan 18 10:36:16 2015	(r377316)
@@ -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 *

Added: head/net/libnet/files/patch-src-libnet_if_addr.c
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/net/libnet/files/patch-src-libnet_if_addr.c	Sun Jan 18 10:36:16 2015	(r377316)
@@ -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() */

Added: head/net/libnet/files/patch-src-libnet_link_bpf.c
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/net/libnet/files/patch-src-libnet_link_bpf.c	Sun Jan 18 10:36:16 2015	(r377316)
@@ -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);
+ }
+ 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201501181036.t0IAaHEO049489>