Skip to content

Commit

Permalink
bpf: fix build due to missing tc_verd
Browse files Browse the repository at this point in the history
fix build error:
net/core/filter.c: In function 'bpf_clone_redirect':
net/core/filter.c:1429:18: error: 'struct sk_buff' has no member named 'tc_verd'
  if (G_TC_AT(skb2->tc_verd) & AT_INGRESS)

Fixes: 3896d65 ("bpf: introduce bpf_clone_redirect() helper")
Reported-by: Or Gerlitz <gerlitz.or@gmail.com>
Reported-by: Fengguang Wu <fengguang.wu@intel.com>
Signed-off-by: Alexei Starovoitov <ast@plumgrid.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Alexei Starovoitov authored and David S. Miller committed Jun 4, 2015
1 parent c39c4c6 commit 94db13f
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions net/core/filter.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@
#include <linux/seccomp.h>
#include <linux/if_vlan.h>
#include <linux/bpf.h>
#include <net/sch_generic.h>

/**
* sk_filter - run a packet through a socket filter
Expand Down Expand Up @@ -1426,8 +1425,7 @@ static u64 bpf_clone_redirect(u64 r1, u64 ifindex, u64 flags, u64 r4, u64 r5)
if (unlikely(!skb2))
return -ENOMEM;

if (G_TC_AT(skb2->tc_verd) & AT_INGRESS)
skb_push(skb2, skb2->mac_len);
skb_push(skb2, skb2->data - skb_mac_header(skb2));

if (BPF_IS_REDIRECT_INGRESS(flags))
return dev_forward_skb(dev, skb2);
Expand Down

0 comments on commit 94db13f

Please sign in to comment.