aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/include
diff options
context:
space:
mode:
authorAlexei Starovoitov <ast@kernel.org>2022-05-10 10:49:03 -0700
committerAlexei Starovoitov <ast@kernel.org>2022-05-10 10:49:17 -0700
commitc4423a174d2926c1c165176d17383631d75dfbec (patch)
tree9c0163961af3d8cdf0e122131f9cb4afc37e90e1 /include
parentbpftool: bpf_link_get_from_fd support for LSM programs in lskel (diff)
parentselftests/bpf: Replace bpf_trace_printk in tunnel kernel code (diff)
downloadwireguard-linux-c4423a174d2926c1c165176d17383631d75dfbec.tar.xz
wireguard-linux-c4423a174d2926c1c165176d17383631d75dfbec.zip
Merge branch 'Add source ip in bpf tunnel key'
Kaixi Fan says: ==================== From: Kaixi Fan <fankaixi.li@bytedance.com> Now bpf code could not set tunnel source ip address of ip tunnel. So it could not support flow based tunnel mode completely. Because flow based tunnel mode could set tunnel source, destination ip address and tunnel key simultaneously. Flow based tunnel is useful for overlay networks. And by configuring tunnel source ip address, user could make their networks more elastic. For example, tunnel source ip could be used to select different egress nic interface for different flows with same tunnel destination ip. Another example, user could choose one of multiple ip address of the egress nic interface as the packet's tunnel source ip. Add tunnel and tunnel source testcases in test_progs. Other types of tunnel testcases would be moved to test_progs step by step in the future. v6: - use libbpf api to attach tc progs and remove some shell commands to reduce test runtime based on Alexei Starovoitov's suggestion v5: - fix some code format errors - use bpf kernel code at namespace at_ns0 to set tunnel metadata v4: - fix subject error of first patch v3: - move vxlan tunnel testcases to test_progs - replace bpf_trace_printk with bpf_printk - rename bpf kernel prog section name to tic v2: - merge vxlan tunnel and tunnel source ip testcases in test_tunnel.sh ==================== Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Diffstat (limited to 'include')
-rw-r--r--include/uapi/linux/bpf.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/include/uapi/linux/bpf.h b/include/uapi/linux/bpf.h
index 444fe6f1cf35..95a3d1ff6255 100644
--- a/include/uapi/linux/bpf.h
+++ b/include/uapi/linux/bpf.h
@@ -5604,6 +5604,10 @@ struct bpf_tunnel_key {
__u8 tunnel_ttl;
__u16 tunnel_ext; /* Padding, future use. */
__u32 tunnel_label;
+ union {
+ __u32 local_ipv4;
+ __u32 local_ipv6[4];
+ };
};
/* user accessible mirror of in-kernel xfrm_state.