aboutsummaryrefslogtreecommitdiffstats
path: root/usr
diff options
context:
space:
mode:
authorDaniel Borkmann <daniel@iogearbox.net>2016-06-28 12:18:28 +0200
committerDavid S. Miller <davem@davemloft.net>2016-06-30 05:54:40 -0400
commitd2485c4242a826fdf493fd3a27b8b792965b9b9e (patch)
treed02f10ddd1ad1f4e5d280ab8e285f7ab450312fc /usr
parentbpf: add bpf_skb_change_proto helper (diff)
downloadlinux-dev-d2485c4242a826fdf493fd3a27b8b792965b9b9e.tar.xz
linux-dev-d2485c4242a826fdf493fd3a27b8b792965b9b9e.zip
bpf: add bpf_skb_change_type helper
This work adds a helper for changing skb->pkt_type in a controlled way. We only allow a subset of possible values and can extend that in future should other use cases come up. Doing this as a helper has the advantage that errors can be handeled gracefully and thus helper kept extensible. It's a write counterpart to pkt_type member we can already read from struct __sk_buff context. Major use case is to change incoming skbs to PACKET_HOST in a programmatic way instead of having to recirculate via redirect(..., BPF_F_INGRESS), for example. Signed-off-by: Daniel Borkmann <daniel@iogearbox.net> Acked-by: Alexei Starovoitov <ast@kernel.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'usr')
0 files changed, 0 insertions, 0 deletions