ipv4: add new arguments to udp_tunnel_dst_lookup()
authorBeniamino Galvani <b.galvani@gmail.com>
Mon, 16 Oct 2023 07:15:22 +0000 (09:15 +0200)
committerDavid S. Miller <davem@davemloft.net>
Mon, 16 Oct 2023 08:57:52 +0000 (09:57 +0100)
commit72fc68c6356b663a8763f02d9b0ec773d59a4949
tree82f2a53038f982c21cdff958e31a74ff56f2f909
parent78f3655adcb52412275f282267ee771421731632
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>
drivers/net/bareudp.c
include/net/udp_tunnel.h
net/ipv4/udp_tunnel_core.c