]> The Tcpdump Group git mirrors - libpcap/commitdiff
fix Linux build errors after commit fb20696
authorDenis Ovsienko <[email protected]>
Sat, 13 Feb 2016 19:28:36 +0000 (19:28 +0000)
committerDenis Ovsienko <[email protected]>
Sat, 13 Feb 2016 19:30:46 +0000 (19:30 +0000)
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

gencode.c

index f1b3b75c75381f488abae29096951c93a8a6075d..28df756ddea68a8ae199a17434d3165ba627417f 100644 (file)
--- 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