summaryrefslogtreecommitdiffstats
path: root/include/net
diff options
context:
space:
mode:
authorBeniamino Galvani <b.galvani@gmail.com>2023-10-16 09:15:22 +0200
committerDavid S. Miller <davem@davemloft.net>2023-10-16 10:57:52 +0200
commit72fc68c6356b663a8763f02d9b0ec773d59a4949 (patch)
tree82f2a53038f982c21cdff958e31a74ff56f2f909 /include/net
parentipv4: remove "proto" argument from udp_tunnel_dst_lookup() (diff)
downloadlinux-72fc68c6356b663a8763f02d9b0ec773d59a4949.tar.xz
linux-72fc68c6356b663a8763f02d9b0ec773d59a4949.zip
ipv4: add new arguments to udp_tunnel_dst_lookup()
We want to make the function more generic so that it can be used by other UDP tunnel implementations such as geneve and vxlan. To do that, add the following arguments: - source and destination UDP port; - ifindex of the output interface, needed by vxlan; - the tos, because in some cases it is not taken from struct ip_tunnel_info (for example, when it's inherited from the inner packet); - the dst cache, because not all tunnel types (e.g. vxlan) want to use the one from struct ip_tunnel_info. With these parameters, the function no longer needs the full struct ip_tunnel_info as argument and we can pass only the relevant part of it (struct ip_tunnel_key). Suggested-by: Guillaume Nault <gnault@redhat.com> Signed-off-by: Beniamino Galvani <b.galvani@gmail.com> Reviewed-by: David Ahern <dsahern@kernel.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net')
-rw-r--r--include/net/udp_tunnel.h8
1 files changed, 5 insertions, 3 deletions
diff --git a/include/net/udp_tunnel.h b/include/net/udp_tunnel.h
index 8f110dbd3784..4d0578fab01a 100644
--- a/include/net/udp_tunnel.h
+++ b/include/net/udp_tunnel.h
@@ -164,9 +164,11 @@ void udp_tunnel_sock_release(struct socket *sock);
struct rtable *udp_tunnel_dst_lookup(struct sk_buff *skb,
struct net_device *dev,
- struct net *net, __be32 *saddr,
- const struct ip_tunnel_info *info,
- bool use_cache);
+ struct net *net, int oif,
+ __be32 *saddr,
+ const struct ip_tunnel_key *key,
+ __be16 sport, __be16 dport, u8 tos,
+ struct dst_cache *dst_cache);
struct metadata_dst *udp_tun_rx_dst(struct sk_buff *skb, unsigned short family,
__be16 flags, __be64 tunnel_id,