linux/include
Christian Ehrig e26aa600ba 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
2022-12-19 23:53:15 +01:00
..
acpi - Make ghes_edac a simple module like the rest of the EDAC drivers and 2022-12-12 14:47:31 -08:00
asm-generic Updates for the interrupt core and driver subsystem: 2022-12-12 11:21:29 -08:00
clocksource Updates for timers, timekeeping and drivers: 2022-12-12 12:52:02 -08:00
crypto
drm Some deferred-io and damage worker reworks revert and make a fb function 2022-12-09 11:53:52 +10:00
dt-bindings A pile of clk driver updates with a small tracepoint patch to the clk core this 2022-12-13 13:46:07 -08:00
keys
kunit kunit: add macro to allow conditionally exposing static symbols to tests 2022-12-12 14:13:48 -07:00
kvm
linux bpf: Remove trace_printk_lock 2022-12-19 22:08:37 +01:00
math-emu
media Merge tag 'br-v6.2i' of git://linuxtv.org/hverkuil/media_tree into media_stage 2022-12-07 17:58:47 +01:00
memory
misc
net Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2022-12-13 09:49:29 +01:00
pcmcia
ras
rdma
rv
scsi
soc Networking changes for 6.2. 2022-12-13 15:47:48 -08:00
sound ASoC: Updates for v6.2 2022-12-06 11:13:26 +01:00
target
trace Networking changes for 6.2. 2022-12-13 15:47:48 -08:00
uapi bpf: Add flag BPF_F_NO_TUNNEL_KEY to bpf_skb_set_tunnel_key() 2022-12-19 23:53:15 +01:00
ufs
vdso
video
xen xen: fix xen.h build for CONFIG_XEN_PVH=y 2022-12-05 12:59:49 +01:00