aboutsummaryrefslogtreecommitdiff
path: root/net/libpcap
diff options
context:
space:
mode:
authorRenato Botelho <garga@FreeBSD.org>2016-08-05 18:41:21 +0000
committerRenato Botelho <garga@FreeBSD.org>2016-08-05 18:41:21 +0000
commitb05527963014847cfec6c22820355c7177ecb962 (patch)
tree8ff181ff9f076122b71cb47a40aee4d41ad135b8 /net/libpcap
parenta4d2b1102a91e47ee0abbd1abc91eaabfda22909 (diff)
downloadports-b05527963014847cfec6c22820355c7177ecb962.tar.gz
ports-b05527963014847cfec6c22820355c7177ecb962.zip
Fix net/libpcap build without IPV6
Obtained from: https://github.com/DragonFlyBSD/DeltaPorts/pull/602 Sponsored by: Rubicon Communications (Netgate)
Notes
Notes: svn path=/head/; revision=419703
Diffstat (limited to 'net/libpcap')
-rw-r--r--net/libpcap/Makefile1
-rw-r--r--net/libpcap/files/patch-gencode.c45
2 files changed, 46 insertions, 0 deletions
diff --git a/net/libpcap/Makefile b/net/libpcap/Makefile
index 15290e6ce70d..47a53c4b44cf 100644
--- a/net/libpcap/Makefile
+++ b/net/libpcap/Makefile
@@ -3,6 +3,7 @@
PORTNAME= libpcap
PORTVERSION= 1.8.0
+PORTREVISION= 1
CATEGORIES= net ipv6
MASTER_SITES= http://www.tcpdump.org/release/
diff --git a/net/libpcap/files/patch-gencode.c b/net/libpcap/files/patch-gencode.c
new file mode 100644
index 000000000000..222316cdf90c
--- /dev/null
+++ b/net/libpcap/files/patch-gencode.c
@@ -0,0 +1,45 @@
+--- gencode.c.orig 2016-07-30 13:42:44 UTC
++++ gencode.c
+@@ -523,7 +523,8 @@ static struct block *gen_host6(compiler_
+ struct in6_addr *, int, int, int);
+ #endif
+ #ifndef INET6
+-static struct block *gen_gateway(const u_char *, bpf_u_int32 **, int, int);
++static struct block *gen_gateway(compiler_state_t *, const u_char *,
++ bpf_u_int32 **, int, int);
+ #endif
+ static struct block *gen_ipfrag(compiler_state_t *);
+ static struct block *gen_portatom(compiler_state_t *, int, bpf_int32);
+@@ -690,7 +691,9 @@ pcap_compile(pcap_t *p, struct bpf_progr
+ }
+ initchunks(&cstate);
+ cstate.no_optimize = 0;
++#ifdef INET6
+ cstate.ai = NULL;
++#endif
+ cstate.ic.root = NULL;
+ cstate.ic.cur_mark = 0;
+ cstate.bpf_pcap = p;
+@@ -4846,11 +4849,8 @@ gen_host6(compiler_state_t *cstate, stru
+
+ #ifndef INET6
+ static struct block *
+-gen_gateway(eaddr, alist, proto, dir)
+- const u_char *eaddr;
+- bpf_u_int32 **alist;
+- int proto;
+- int dir;
++gen_gateway(compiler_state_t *cstate, const u_char *eaddr,
++ bpf_u_int32 **alist, int proto, int dir)
+ {
+ struct block *b0, *b1, *tmp;
+
+@@ -6414,7 +6414,7 @@ gen_scode(compiler_state_t *cstate, cons
+ alist = pcap_nametoaddr(name);
+ if (alist == NULL || *alist == NULL)
+ bpf_error(cstate, "unknown host '%s'", name);
+- b = gen_gateway(eaddr, alist, proto, dir);
++ b = gen_gateway(cstate, eaddr, alist, proto, dir);
+ free(eaddr);
+ return b;
+ #else