summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLorenzo Colitti <lorenzo@google.com>2020-04-20 11:34:08 -0700
committerAlexei Starovoitov <ast@kernel.org>2020-04-26 09:00:50 -0700
commit6f3f65d80dac8f2bafce2213005821fccdce194c (patch)
tree84e4007084a04076e2386d939cc07c915d37b231
parent6890896bd765b0504761c61901c9804fca23bfb2 (diff)
downloadlinux-stable-6f3f65d80dac8f2bafce2213005821fccdce194c.tar.gz
linux-stable-6f3f65d80dac8f2bafce2213005821fccdce194c.tar.bz2
linux-stable-6f3f65d80dac8f2bafce2213005821fccdce194c.zip
net: bpf: Allow TC programs to call BPF_FUNC_skb_change_head
This allows TC eBPF programs to modify and forward (redirect) packets from interfaces without ethernet headers (for example cellular) to interfaces with (for example ethernet/wifi). The lack of this appears to simply be an oversight. Tested: in active use in Android R on 4.14+ devices for ipv6 cellular to wifi tethering offload. Signed-off-by: Lorenzo Colitti <lorenzo@google.com> Signed-off-by: Maciej Żenczykowski <maze@google.com> Signed-off-by: Alexei Starovoitov <ast@kernel.org>
-rw-r--r--net/core/filter.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/net/core/filter.c b/net/core/filter.c
index a605626142b6..da3b7a72c37c 100644
--- a/net/core/filter.c
+++ b/net/core/filter.c
@@ -6137,6 +6137,8 @@ tc_cls_act_func_proto(enum bpf_func_id func_id, const struct bpf_prog *prog)
return &bpf_skb_adjust_room_proto;
case BPF_FUNC_skb_change_tail:
return &bpf_skb_change_tail_proto;
+ case BPF_FUNC_skb_change_head:
+ return &bpf_skb_change_head_proto;
case BPF_FUNC_skb_get_tunnel_key:
return &bpf_skb_get_tunnel_key_proto;
case BPF_FUNC_skb_set_tunnel_key: