Skip to content

Commit

Permalink
samples/bpf: add missing <linux/if_vlan.h>
Browse files Browse the repository at this point in the history
This fixes build error regarding redefinition:

    CLANG-bpf  samples/bpf/parse_varlen.o
  samples/bpf/parse_varlen.c:111:8: error: redefinition of 'vlan_hdr'
  struct vlan_hdr {
         ^
  ./include/linux/if_vlan.h:38:8: note: previous definition is here

So remove duplicate 'struct vlan_hdr' in sample code and include if_vlan.h

Signed-off-by: Taeung Song <treeze.taeung@gmail.com>
Acked-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
  • Loading branch information
Taeung authored and borkmann committed Jul 5, 2018
1 parent ed2b82c commit 4d5d33a
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions samples/bpf/parse_varlen.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
*/
#define KBUILD_MODNAME "foo"
#include <linux/if_ether.h>
#include <linux/if_vlan.h>
#include <linux/ip.h>
#include <linux/ipv6.h>
#include <linux/in.h>
Expand Down Expand Up @@ -108,11 +109,6 @@ static int parse_ipv6(void *data, uint64_t nh_off, void *data_end)
return 0;
}

struct vlan_hdr {
uint16_t h_vlan_TCI;
uint16_t h_vlan_encapsulated_proto;
};

SEC("varlen")
int handle_ingress(struct __sk_buff *skb)
{
Expand Down

0 comments on commit 4d5d33a

Please sign in to comment.