From: Denis Ovsienko Date: Sat, 13 Feb 2016 19:28:36 +0000 (+0000) Subject: fix Linux build errors after commit fb20696 X-Git-Tag: libpcap-1.8.0-bp~60 X-Git-Url: https://git.tcpdump.org/libpcap/commitdiff_plain/3f0a659b745be29d7fa034270e56ca2f7fa625fe fix Linux build errors after commit fb20696 Travis CI build was OK but on my Ubuntu 14.04 PC it would fail: ./gencode.c: In function ‘gen_vlan_bpf_extensions’: ./gencode.c:7902:22: error: ‘cstate’ undeclared (first use in this function) s = new_stmt(cstate, BPF_LD|BPF_B|BPF_ABS); ^ ./gencode.c:7902:22: note: each undeclared identifier is reported only once for each function it appears in ./gencode.c: In function ‘gen_vlan’: ./gencode.c:8015:7: error: ‘off_outermostlinkhdr’ undeclared (first use in this function) off_outermostlinkhdr.constant_part) { ^ make: *** [gencode.o] Error 1 --- diff --git a/gencode.c b/gencode.c index f1b3b75c..28df756d 100644 --- a/gencode.c +++ b/gencode.c @@ -7892,7 +7892,7 @@ gen_ahostop(compiler_state_t *cstate, const u_char *eaddr, int dir) #if defined(SKF_AD_VLAN_TAG) && defined(SKF_AD_VLAN_TAG_PRESENT) static struct block * -gen_vlan_bpf_extensions(int vlan_num) +gen_vlan_bpf_extensions(compiler_state_t *cstate, int vlan_num) { struct block *b0, *b1; struct slist *s; @@ -8012,12 +8012,12 @@ gen_vlan(compiler_state_t *cstate, int vlan_num) * not encapsulated somehow. */ if (cstate->vlan_stack_depth == 0 && !cstate->off_linkhdr.is_variable && cstate->off_linkhdr.constant_part == - off_outermostlinkhdr.constant_part) { + cstate->off_outermostlinkhdr.constant_part) { /* * Do we need special VLAN handling? */ if (cstate->bpf_pcap->bpf_codegen_flags & BPF_SPECIAL_VLAN_HANDLING) - b0 = gen_vlan_bpf_extensions(vlan_num); + b0 = gen_vlan_bpf_extensions(cstate, vlan_num); else b0 = gen_vlan_no_bpf_extensions(cstate, vlan_num); } else