summaryrefslogtreecommitdiff
path: root/tools/testing/selftests/bpf/test_tunnel.sh
diff options
context:
space:
mode:
authorChristian Ehrig <cehrig@cloudflare.com>2022-12-18 06:17:31 +0100
committerDaniel Borkmann <daniel@iogearbox.net>2022-12-19 23:53:15 +0100
commite26aa600ba6a62fe84659f1df497a381bab6d07e (patch)
treee3b62bb22080d89e5e87891ef8f390360e2c1b5b /tools/testing/selftests/bpf/test_tunnel.sh
parent64f4660f691c61506828faef38ef374811fbbe71 (diff)
bpf: Add flag BPF_F_NO_TUNNEL_KEY to bpf_skb_set_tunnel_key()
This patch allows to remove TUNNEL_KEY from the tunnel flags bitmap when using bpf_skb_set_tunnel_key by providing a BPF_F_NO_TUNNEL_KEY flag. On egress, the resulting tunnel header will not contain a tunnel key if the protocol and implementation supports it. At the moment bpf_tunnel_key wants a user to specify a numeric tunnel key. This will wrap the inner packet into a tunnel header with the key bit and value set accordingly. This is problematic when using a tunnel protocol that supports optional tunnel keys and a receiving tunnel device that is not expecting packets with the key bit set. The receiver won't decapsulate and drop the packet. RFC 2890 and RFC 2784 GRE tunnels are examples where this flag is useful. It allows for generating packets, that can be decapsulated by a GRE tunnel device not operating in collect metadata mode or not expecting the key bit set. Signed-off-by: Christian Ehrig <cehrig@cloudflare.com> Signed-off-by: Daniel Borkmann <daniel@iogearbox.net> Reviewed-by: Jakub Sitnicki <jakub@cloudflare.com> Acked-by: Stanislav Fomichev <sdf@google.com> Link: https://lore.kernel.org/bpf/20221218051734.31411-1-cehrig@cloudflare.com
Diffstat (limited to 'tools/testing/selftests/bpf/test_tunnel.sh')
0 files changed, 0 insertions, 0 deletions