[PATCH net-next 4/7] ipv4: use tunnel flow flags for tunnel route lookups

Beniamino Galvani posted 7 patches 2 years, 2 months ago
There is a newer version of this series
[PATCH net-next 4/7] ipv4: use tunnel flow flags for tunnel route lookups
Posted by Beniamino Galvani 2 years, 2 months ago
Commit 451ef36bd229 ("ip_tunnels: Add new flow flags field to
ip_tunnel_key") added a new field to struct ip_tunnel_key to control
route lookups. Currently the flag is used by vxlan and geneve tunnels;
use it also in udp_tunnel_dst_lookup() so that it affects all tunnel
types relying on this function.

Signed-off-by: Beniamino Galvani <b.galvani@gmail.com>
---
 net/ipv4/udp_tunnel_core.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/net/ipv4/udp_tunnel_core.c b/net/ipv4/udp_tunnel_core.c
index 494685e82856..a87defb2b167 100644
--- a/net/ipv4/udp_tunnel_core.c
+++ b/net/ipv4/udp_tunnel_core.c
@@ -232,6 +232,7 @@ struct rtable *udp_tunnel_dst_lookup(struct sk_buff *skb,
 	fl4.fl4_dport = dport;
 	fl4.fl4_sport = sport;
 	fl4.flowi4_tos = RT_TOS(tos);
+	fl4.flowi4_flags = key->flow_flags;
 
 	rt = ip_route_output_key(net, &fl4);
 	if (IS_ERR(rt)) {
-- 
2.40.1
Re: [PATCH net-next 4/7] ipv4: use tunnel flow flags for tunnel route lookups
Posted by David Ahern 2 years, 2 months ago
On 10/9/23 2:20 AM, Beniamino Galvani wrote:
> Commit 451ef36bd229 ("ip_tunnels: Add new flow flags field to
> ip_tunnel_key") added a new field to struct ip_tunnel_key to control
> route lookups. Currently the flag is used by vxlan and geneve tunnels;
> use it also in udp_tunnel_dst_lookup() so that it affects all tunnel
> types relying on this function.
> 
> Signed-off-by: Beniamino Galvani <b.galvani@gmail.com>
> ---
>  net/ipv4/udp_tunnel_core.c | 1 +
>  1 file changed, 1 insertion(+)
> 

Reviewed-by: David Ahern <dsahern@kernel.org>