summaryrefslogtreecommitdiffstats
path: root/samples/bpf
diff options
context:
space:
mode:
authorTaeung Song <treeze.taeung@gmail.com>2018-07-04 22:36:36 +0900
committerDaniel Borkmann <daniel@iogearbox.net>2018-07-05 09:58:52 +0200
commit4d5d33a085335ef469c9a87792bcaaaa8e64d8c4 (patch)
tree7a9235f7f6836daeae60d9b31b80e240c7f32715 /samples/bpf
parented2b82c03dc187018307c7c6bf9299705f3db383 (diff)
downloadlinux-stable-4d5d33a085335ef469c9a87792bcaaaa8e64d8c4.tar.gz
linux-stable-4d5d33a085335ef469c9a87792bcaaaa8e64d8c4.tar.bz2
linux-stable-4d5d33a085335ef469c9a87792bcaaaa8e64d8c4.zip
samples/bpf: add missing <linux/if_vlan.h>
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>
Diffstat (limited to 'samples/bpf')
-rw-r--r--samples/bpf/parse_varlen.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/samples/bpf/parse_varlen.c b/samples/bpf/parse_varlen.c
index 95c16324760c..0b6f22feb2c9 100644
--- a/samples/bpf/parse_varlen.c
+++ b/samples/bpf/parse_varlen.c
@@ -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>
@@ -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)
{