Index: head/net/libnet/Makefile =================================================================== --- head/net/libnet/Makefile (revision 377315) +++ head/net/libnet/Makefile (revision 377316) @@ -1,60 +1,60 @@ # Created by: shipley@dis.org # $FreeBSD$ PORTNAME= libnet PORTVERSION= 1.1.6 -PORTREVISION= 2 +PORTREVISION= 3 PORTEPOCH= 1 CATEGORIES= net MASTER_SITES= SF/libnet-dev MAINTAINER= sunpoet@FreeBSD.org COMMENT= C library for creating IP packets LICENSE= BSD2CLAUSE OPTIONS_DEFINE= BPF DOCS EXAMPLES OPTIONS_DEFAULT=BPF BPF_DESC= link layer bpf GNU_CONFIGURE= yes INSTALL_TARGET= install-strip USE_CSTD= gnu89 USE_LDCONFIG= yes USES= libtool SHORT_NAME= ${PORTNAME}11 DOCSDIR= ${PREFIX}/share/doc/${SHORT_NAME} EXAMPLESDIR= ${PREFIX}/share/examples/${SHORT_NAME} USE_LDCONFIG= ${PREFIX}/lib/${SHORT_NAME} PLIST_SUB= SNAME=${SHORT_NAME} VERSION=${PORTVERSION} DOCS= README doc/CHANGELOG doc/CONTRIB doc/COPYING \ doc/DESIGN_NOTES doc/MIGRATION doc/PACKET_BUILDING doc/PORTED \ doc/RAWSOCKET_NON_SEQUITUR doc/TODO EXAMPLES= sample/*.c BPF_CONFIGURE_OFF= --with-link-layer=none BPF_CONFIGURE_ON= --with-link-layer=bpf post-patch: @${REINPLACE_CMD} \ -e 's|@LIBNET_CONFIG_LIBS@|@LIBNET_CONFIG_LIBS@ -L@prefix@/lib/${SHORT_NAME}|' \ -e 's|@LIBNET_CONFIG_CFLAGS@|@LIBNET_CONFIG_CFLAGS@ -I@prefix@/include/${SHORT_NAME}|' \ ${WRKSRC}/libnet-config.in @${REINPLACE_CMD} -e 's|^includedir =.*|includedir = @includedir@/${SHORT_NAME}|' \ ${WRKSRC}/include/Makefile.in \ ${WRKSRC}/include/libnet/Makefile.in @${REINPLACE_CMD} -e 's|^libdir =.*|libdir = @libdir@/${SHORT_NAME}|' \ -e 's|^libnet_la_LDFLAGS =\(.*\)|libnet_la_LDFLAGS =\1 -soname=libnet-${SHORT_NAME}.so.1|' \ ${WRKSRC}/src/Makefile.in post-install: ${INSTALL_SCRIPT} ${WRKSRC}/libnet-config ${STAGEDIR}${PREFIX}/bin/${SHORT_NAME}-config ${LN} -fs ${SHORT_NAME}/libnet.so.1 ${STAGEDIR}${PREFIX}/lib/libnet-${PORTVERSION}.so.1 ${MKDIR} ${STAGEDIR}${DOCSDIR}/ cd ${WRKSRC}/ && ${INSTALL_DATA} ${DOCS} ${STAGEDIR}${DOCSDIR}/ ${MKDIR} ${STAGEDIR}${EXAMPLESDIR}/ cd ${WRKSRC}/ && ${INSTALL_DATA} ${EXAMPLES} ${STAGEDIR}${EXAMPLESDIR}/ .include Index: head/net/libnet/files/patch-libnet.h.in =================================================================== --- head/net/libnet/files/patch-libnet.h.in (revision 377315) +++ head/net/libnet/files/patch-libnet.h.in (nonexistent) @@ -1,12 +0,0 @@ ---- 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 - # include -+# if defined (__FreeBSD__) || defined (__DragonFly__) -+# include -+# endif - #else /* __WIN32__ */ - # if (__CYGWIN__) - # include Property changes on: head/net/libnet/files/patch-libnet.h.in ___________________________________________________________________ Deleted: fbsd:nokeywords ## -1 +0,0 ## -yes \ No newline at end of property Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Deleted: svn:mime-type ## -1 +0,0 ## -text/plain \ No newline at end of property Index: head/net/libnet/files/patch-include-libnet.h.in =================================================================== --- head/net/libnet/files/patch-include-libnet.h.in (nonexistent) +++ head/net/libnet/files/patch-include-libnet.h.in (revision 377316) @@ -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 + # include ++# if defined (__FreeBSD__) || defined (__DragonFly__) ++# include ++# endif + #else /* __WIN32__ */ + # if (__CYGWIN__) + # include Property changes on: head/net/libnet/files/patch-include-libnet.h.in ___________________________________________________________________ Added: fbsd:nokeywords ## -0,0 +1 ## +yes \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: head/net/libnet/files/patch-src-libnet_cq.c =================================================================== --- head/net/libnet/files/patch-src-libnet_cq.c (nonexistent) +++ head/net/libnet/files/patch-src-libnet_cq.c (revision 377316) @@ -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 * Property changes on: head/net/libnet/files/patch-src-libnet_cq.c ___________________________________________________________________ Added: fbsd:nokeywords ## -0,0 +1 ## +yes \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: head/net/libnet/files/patch-src-libnet_if_addr.c =================================================================== --- head/net/libnet/files/patch-src-libnet_if_addr.c (nonexistent) +++ head/net/libnet/files/patch-src-libnet_if_addr.c (revision 377316) @@ -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() */ Property changes on: head/net/libnet/files/patch-src-libnet_if_addr.c ___________________________________________________________________ Added: fbsd:nokeywords ## -0,0 +1 ## +yes \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: head/net/libnet/files/patch-src-libnet_link_bpf.c =================================================================== --- head/net/libnet/files/patch-src-libnet_link_bpf.c (nonexistent) +++ head/net/libnet/files/patch-src-libnet_link_bpf.c (revision 377316) @@ -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); + } + Property changes on: head/net/libnet/files/patch-src-libnet_link_bpf.c ___________________________________________________________________ Added: fbsd:nokeywords ## -0,0 +1 ## +yes \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property