]> git.baikalelectronics.ru Git - kernel.git/commit
bpf: add bpf_skb_adjust_room mode BPF_ADJ_ROOM_MAC
authorWillem de Bruijn <willemb@google.com>
Fri, 22 Mar 2019 18:32:54 +0000 (14:32 -0400)
committerAlexei Starovoitov <ast@kernel.org>
Fri, 22 Mar 2019 20:52:45 +0000 (13:52 -0700)
commit7263d95065714edff272875f19e64c3aa04c14b3
tree337408444ce554606978d20087e22e4a6ad4a59c
parent373c3dcc57637e19c131a7521a8c83be50ae397a
bpf: add bpf_skb_adjust_room mode BPF_ADJ_ROOM_MAC

bpf_skb_adjust_room net allows inserting room in an skb.

Existing mode BPF_ADJ_ROOM_NET inserts room after the network header
by pulling the skb, moving the network header forward and zeroing the
new space.

Add new mode BPF_ADJUST_ROOM_MAC that inserts room after the mac
header. This allows inserting tunnel headers in front of the network
header without having to recreate the network header in the original
space, avoiding two copies.

Signed-off-by: Willem de Bruijn <willemb@google.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
include/uapi/linux/bpf.h
net/core/filter.c