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
#if defined(SKF_AD_VLAN_TAG) && defined(SKF_AD_VLAN_TAG_PRESENT)
static struct block *
#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;
{
struct block *b0, *b1;
struct slist *s;
* not encapsulated somehow. */
if (cstate->vlan_stack_depth == 0 && !cstate->off_linkhdr.is_variable &&
cstate->off_linkhdr.constant_part ==
* 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)
/*
* 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
else
b0 = gen_vlan_no_bpf_extensions(cstate, vlan_num);
} else