]> git.baikalelectronics.ru Git - kernel.git/commit
bpf: support ipv6 for bpf_skb_{set,get}_tunnel_key
authorDaniel Borkmann <daniel@iogearbox.net>
Mon, 11 Jan 2016 00:16:39 +0000 (01:16 +0100)
committerDavid S. Miller <davem@davemloft.net>
Mon, 11 Jan 2016 22:32:55 +0000 (17:32 -0500)
commit28378fa88dec11098ae1250c0c56033d63d216c0
tree65fd4eeb16e674c7b7257601116a82a3ce204e61
parent99c1d2d12b189cfc2d5a2d18baa78ed328d687da
bpf: support ipv6 for bpf_skb_{set,get}_tunnel_key

After IPv6 support has recently been added to metadata dst and related
encaps, add support for populating/reading it from an eBPF program.

Commit 1d4f135e28 ("bpf: add helpers to access tunnel metadata") started
with initial IPv4-only support back then (due to IPv6 metadata support
not being available yet).

To stay compatible with older programs, we need to test for the passed
structure size. Also TOS and TTL support from the ip_tunnel_info key has
been added. Tested with vxlan devs in collect meta data mode with IPv4,
IPv6 and in compat mode over different network namespaces.

Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/uapi/linux/bpf.h
net/core/filter.c