Commit 2b533dae authored by Taeung Song's avatar Taeung Song Committed by Greg Kroah-Hartman

samples/bpf: add missing <linux/if_vlan.h>

[ Upstream commit 4d5d33a0 ]

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: default avatarTaeung Song <>
Acked-by: default avatarDavid S. Miller <>
Signed-off-by: default avatarDaniel Borkmann <>
Signed-off-by: default avatarSasha Levin <>
Signed-off-by: default avatarGreg Kroah-Hartman <>
parent bf030b2f
......@@ -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;
int handle_ingress(struct __sk_buff *skb)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment