Subject: Re: [PATCH net-next 5/8] tunnel: do not confirm neighbor when do pmtu update

From: Guillaume Nault <[email-masked]>
Date: Thu, 19 Dec 2019 18:47:20 +0100

On Wed, Dec 18, 2019 at 07:53:10PM +0800, Hangbin Liu wrote:
> When do IPv6 tunnel PMTU update and calls __ip6_rt_update_pmtu() in the end,
> we should not call dst_confirm_neigh() as there is no two-way communication.
> 
> Although ipv4 tunnel is not affected as __ip_rt_update_pmtu() does not call
> dst_confirm_neigh(), we still not do neigh confirm to keep consistency with
> IPv6 code.
> 
This is a bit confusing. IPv4 tunnels (e.g. gretap) are affected, as show
by your reproducer. Quoting patch 0:
"""
  The reason is when we ping6 remote via gretap, we will call like

  gre_tap_xmit()
   - ip_tunnel_xmit()
     - tnl_update_pmtu()
       - skb_dst_update_pmtu()
         - ip6_rt_update_pmtu()
           - __ip6_rt_update_pmtu()
             - dst_confirm_neigh()
               - ip6_confirm_neigh()
                 - __ipv6_confirm_neigh()
                   - n->confirmed = now
"""

IPv4 is not affected if it's on the overlay, but that's not what is
this patch cares about. Unless I've misunderstood this paragraph, I
think that you can just delete it.

> Signed-off-by: Hangbin Liu <[email-masked]>
> ---
>  net/ipv4/ip_tunnel.c  | 2 +-
>  net/ipv6/ip6_tunnel.c | 4 ++--
>  2 files changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/net/ipv4/ip_tunnel.c b/net/ipv4/ip_tunnel.c
> index 38c02bb62e2c..0fe2a5d3e258 100644
> --- a/net/ipv4/ip_tunnel.c
> +++ b/net/ipv4/ip_tunnel.c
> @@ -505,7 +505,7 @@ static int tnl_update_pmtu(struct net_device *dev, struct sk_buff *skb,
>  		mtu = skb_valid_dst(skb) ? dst_mtu(skb_dst(skb)) : dev->mtu;
>  
>  	if (skb_valid_dst(skb))
> -		skb_dst_update_pmtu(skb, mtu);
> +		skb_dst_update_pmtu_no_confirm(skb, mtu);
>  

Fixes: 0dec879f636f ("net: use dst_confirm_neigh for UDP, RAW, ICMP, L2TP")