aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorXin LI <delphij@FreeBSD.org>2017-03-29 03:28:09 +0000
committerXin LI <delphij@FreeBSD.org>2017-03-29 03:28:09 +0000
commit2369c04eb959fda4140b71f1c78798251bf43b62 (patch)
tree46106041a48b8a3896c2c01c24d234cbfd48bc2d
parent5ca946f041e6241d5cf55541828970a621f3e349 (diff)
downloadsrc-2369c04eb959fda4140b71f1c78798251bf43b62.tar.gz
src-2369c04eb959fda4140b71f1c78798251bf43b62.zip
Apply vendor revision 470df104c6f55f6d6f390df7448d8eb65c7642b9:
From: Guy Harris <guy@alum.mit.edu> Subject: [PATCH] Fix compilation if INET6 isn't defined. Addresses GitHub issue #541, but differently from the pull request (it defines gen_gateway() with a function prototype rather than using a pre-prototype-style definition).
Notes
Notes: svn path=/vendor/libpcap/dist/; revision=316124
-rw-r--r--gencode.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/gencode.c b/gencode.c
index a887f2730f7a..60494e3de974 100644
--- a/gencode.c
+++ b/gencode.c
@@ -523,7 +523,8 @@ static struct block *gen_host6(compiler_state_t *, struct in6_addr *,
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_program *program,
}
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;
@@ -4902,11 +4905,8 @@ gen_host6(compiler_state_t *cstate, struct in6_addr *addr,
#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;
@@ -6470,7 +6470,7 @@ gen_scode(compiler_state_t *cstate, const char *name, struct qual q)
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