Index: head/net/libnet/Makefile =================================================================== --- head/net/libnet/Makefile (revision 434088) +++ head/net/libnet/Makefile (revision 434089) @@ -1,49 +1,55 @@ # Created by: shipley@dis.org # $FreeBSD$ PORTNAME= libnet PORTVERSION= 1.1.6 -PORTREVISION= 4 +PORTREVISION= 5 PORTEPOCH= 1 CATEGORIES= net MASTER_SITES= SF/libnet-dev MAINTAINER= sunpoet@FreeBSD.org COMMENT= C library for creating IP packets LICENSE= BSD2CLAUSE LICENSE_FILE= ${WRKSRC}/doc/COPYING 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 DOCS= CHANGELOG CONTRIB DESIGN_NOTES MIGRATION PACKET_BUILDING PORTED RAWSOCKET_NON_SEQUITUR README TODO PORTDOCS= * PORTEXAMPLES= * BPF_CONFIGURE_OFF= --with-link-layer=none BPF_CONFIGURE_ON= --with-link-layer=bpf post-patch: @${MV} ${WRKSRC}/README ${WRKSRC}/doc/ @${REINPLACE_CMD} \ -e 's|@LIBNET_CONFIG_LIBS@|@LIBNET_CONFIG_LIBS@ -L@prefix@/lib|' \ -e 's|@LIBNET_CONFIG_CFLAGS@|@LIBNET_CONFIG_CFLAGS@ -I@prefix@/include|' \ ${WRKSRC}/libnet-config.in post-install-DOCS-on: ${MKDIR} ${STAGEDIR}${DOCSDIR}/ cd ${WRKSRC}/doc/ && ${INSTALL_DATA} ${DOCS} ${STAGEDIR}${DOCSDIR}/ post-install-EXAMPLES-on: ${MKDIR} ${STAGEDIR}${EXAMPLESDIR}/ ${INSTALL_DATA} ${WRKSRC}/sample/*.c ${STAGEDIR}${EXAMPLESDIR}/ -.include +.include + +.if ${OPSYS} == FreeBSD && ${OSVERSION} >= 1100030 +EXTRA_PATCHES+= ${PATCHDIR}/extra-patch-configure +.endif + +.include Index: head/net/libnet/files/extra-patch-configure =================================================================== --- head/net/libnet/files/extra-patch-configure (nonexistent) +++ head/net/libnet/files/extra-patch-configure (revision 434089) @@ -0,0 +1,17 @@ +--- configure.orig 2012-03-29 21:18:48 UTC ++++ configure +@@ -12165,13 +12165,12 @@ done + $as_echo "#define LIBNET_BSDISH_OS 1" >>confdefs.h + + +-$as_echo "#define LIBNET_BSD_BYTE_SWAP 1" >>confdefs.h + + + $as_echo "#define HAVE_SOCKADDR_SA_LEN 1" >>confdefs.h + + +- LIBNET_CONFIG_DEFINES="-DLIBNET_BSDISH_OS -DLIBNET_BSD_BYTE_SWAP -DHAVE_SOCKADDR_SA_LEN" ++ LIBNET_CONFIG_DEFINES="-DLIBNET_BSDISH_OS -DHAVE_SOCKADDR_SA_LEN" + ;; + + *netbsd*) Property changes on: head/net/libnet/files/extra-patch-configure ___________________________________________________________________ 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-include-libnet.h.in =================================================================== --- head/net/libnet/files/patch-include-libnet.h.in (revision 434088) +++ head/net/libnet/files/patch-include-libnet.h.in (revision 434089) @@ -1,12 +1,12 @@ ---- include/libnet.h.in.orig 2012-03-06 01:45:46.000000000 +0100 +--- include/libnet.h.in.orig 2012-03-06 00:45:46 UTC +++ include/libnet.h.in -@@ -81,6 +81,9 @@ +@@ -81,6 +81,9 @@ extern "C" { #if !defined(__WIN32__) # include # include +# if defined (__FreeBSD__) || defined (__DragonFly__) +# include +# endif #else /* __WIN32__ */ # if (__CYGWIN__) # include Index: head/net/libnet/files/patch-src-libnet_cq.c =================================================================== --- head/net/libnet/files/patch-src-libnet_cq.c (revision 434088) +++ head/net/libnet/files/patch-src-libnet_cq.c (revision 434089) @@ -1,15 +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 @@ +--- src/libnet_cq.c.orig 2012-03-19 16:59:50 UTC ++++ src/libnet_cq.c +@@ -344,6 +344,8 @@ libnet_cq_destroy() libnet_destroy(tmp->context); free(tmp); } + l_cq = NULL; + memset(&l_cqd, 0, sizeof(l_cqd)); } libnet_t * Index: head/net/libnet/files/patch-src-libnet_if_addr.c =================================================================== --- head/net/libnet/files/patch-src-libnet_if_addr.c (revision 434088) +++ head/net/libnet/files/patch-src-libnet_if_addr.c (revision 434089) @@ -1,34 +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 @@ +--- src/libnet_if_addr.c.orig 2012-03-19 16:59:50 UTC ++++ src/libnet_if_addr.c +@@ -330,6 +330,8 @@ register char *errbuf) ++nipaddr; } + pcap_freealldevs(alldevs); + *ipaddrp = ifaddrlist; return (nipaddr); } -@@ -339,7 +341,6 @@ +@@ -339,7 +341,6 @@ int 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 @@ +@@ -364,7 +365,7 @@ libnet_select_device(libnet_t *l) /* * 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() */ Index: head/net/libnet/files/patch-src-libnet_link_bpf.c =================================================================== --- head/net/libnet/files/patch-src-libnet_link_bpf.c (revision 434088) +++ head/net/libnet/files/patch-src-libnet_link_bpf.c (revision 434089) @@ -1,32 +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 @@ +--- src/libnet_link_bpf.c.orig 2012-03-19 16:59:50 UTC ++++ src/libnet_link_bpf.c +@@ -316,7 +316,11 @@ libnet_get_hwaddr(libnet_t *l) 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 @@ +@@ -326,6 +330,12 @@ libnet_get_hwaddr(libnet_t *l) } } 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); }