Skip to contentSkip to conversation

net: bpf: Allow TC programs to call BPF_FUNC_skb_change_head

PATCH Applied Maciej Żenczykowski 2 participants 2 messages Apr 20, 2020 – Apr 26, 2020

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net: bpf: Allow TC programs to call BPF_FUNC_skb_change_head

From: Lorenzo Colitti <[email protected]>

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.

---
 net/core/filter.c | 2 ++
 1 file changed, 2 insertions(+)
net/core/filter.c +2 -0
index 7d6ceaa54d21..755867867e57 100644
@@ -6213,6 +6213,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:
Signature · 1 line
2.26.1.301.g55bc3eb7cb9-goog
#1 lore raw
Quoted 7 lines · Maciej Żenczykowski

From: Lorenzo Colitti <[email protected]>

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).

Quoted 8 lines

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.

Applied. Thanks