netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net] ipv6/route: only update neigh confirm time if pmtu changed
@ 2019-11-22  6:19 Hangbin Liu
  2019-11-22 18:04 ` David Miller
  2019-12-03  2:11 ` [PATCHv2 net] ipv6/route: should not update neigh confirm time during PMTU update Hangbin Liu
  0 siblings, 2 replies; 51+ messages in thread
From: Hangbin Liu @ 2019-11-22  6:19 UTC (permalink / raw)
  To: netdev
  Cc: Julian Anastasov, David S . Miller, Marcelo Ricardo Leitner,
	David Ahern, Eric Dumazet, Hangbin Liu

When we setup a pair of gretap, ping each other and create neighbour cache.
Then delete and recreate one side. We will never be able to ping6 to the new
created gretap.

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

As the confirmed time updated, in neigh_timer_handler() the check for
NUD_DELAY confirm time will pass and the neigh state will back to
NUD_REACHABLE. So the old/wrong mac address will be used again.

If we do not update the confirmed time, the neigh state will go to
neigh->nud_state = NUD_PROBE; then go to NUD_FAILED and re-create the
neigh later, which is what IPv4 does.

Fix it by reordering the dst_confirm_neigh() and only update it when
pmtu changed.

Fixes: 0dec879f636f ("net: use dst_confirm_neigh for UDP, RAW, ICMP, L2TP")
Reported-by: Jianlin Shi <jishi@redhat.com>
Suggested-by: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>
Signed-off-by: Hangbin Liu <liuhangbin@gmail.com>
---
 net/ipv6/route.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/net/ipv6/route.c b/net/ipv6/route.c
index 3f83ea851ebf..6fbef61b8f64 100644
--- a/net/ipv6/route.c
+++ b/net/ipv6/route.c
@@ -2713,11 +2713,12 @@ static void __ip6_rt_update_pmtu(struct dst_entry *dst, const struct sock *sk,
 		daddr = NULL;
 		saddr = NULL;
 	}
-	dst_confirm_neigh(dst, daddr);
 	mtu = max_t(u32, mtu, IPV6_MIN_MTU);
 	if (mtu >= dst_mtu(dst))
 		return;
 
+	dst_confirm_neigh(dst, daddr);
+
 	if (!rt6_cache_allowed_for_pmtu(rt6)) {
 		rt6_do_update_pmtu(rt6, mtu);
 		/* update rt6_ex->stamp for cache */
-- 
2.19.2


^ permalink raw reply related	[flat|nested] 51+ messages in thread

end of thread, other threads:[~2019-12-25  6:30 UTC | newest]

Thread overview: 51+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-22  6:19 [PATCH net] ipv6/route: only update neigh confirm time if pmtu changed Hangbin Liu
2019-11-22 18:04 ` David Miller
2019-11-26  9:17   ` Hangbin Liu
2019-12-03  2:11 ` [PATCHv2 net] ipv6/route: should not update neigh confirm time during PMTU update Hangbin Liu
2019-12-03  2:47   ` David Miller
2019-12-03 10:15     ` Hangbin Liu
2019-12-03 10:25       ` Hangbin Liu
2019-12-03 19:58         ` David Miller
2019-12-10  3:36           ` Hangbin Liu
2019-12-10 17:00             ` Guillaume Nault
2019-12-18 11:53   ` [PATCH net-next 0/8] disable neigh update for tunnels during pmtu update Hangbin Liu
2019-12-18 11:53     ` [PATCH net-next 1/8] net: add bool confirm_neigh parameter for dst_ops.update_pmtu Hangbin Liu
2019-12-18 11:53     ` [PATCH net-next 2/8] ip6_gre: do not confirm neighbor when do pmtu update Hangbin Liu
2019-12-18 11:53     ` [PATCH net-next 3/8] gtp: " Hangbin Liu
2019-12-18 11:53     ` [PATCH net-next 4/8] net/dst: add new function skb_dst_update_pmtu_no_confirm Hangbin Liu
2019-12-18 11:53     ` [PATCH net-next 5/8] tunnel: do not confirm neighbor when do pmtu update Hangbin Liu
2019-12-19 17:47       ` Guillaume Nault
2019-12-20  2:36         ` Hangbin Liu
2019-12-18 11:53     ` [PATCH net-next 6/8] vti: " Hangbin Liu
2019-12-18 11:53     ` [PATCH net-next 7/8] sit: " Hangbin Liu
2019-12-18 11:53     ` [PATCH net-next 8/8] net/dst: do not confirm neighbor for vxlan and geneve " Hangbin Liu
2019-12-19 17:49       ` Guillaume Nault
2019-12-18 12:01     ` [PATCH net-next 0/8] disable neigh update for tunnels during " Hangbin Liu
2019-12-19 17:57       ` Guillaume Nault
2019-12-20  2:48         ` Hangbin Liu
2019-12-19 17:53     ` Guillaume Nault
2019-12-20  3:25     ` [PATCHv4 net " Hangbin Liu
2019-12-20  3:25       ` [PATCHv4 net 1/8] net: add bool confirm_neigh parameter for dst_ops.update_pmtu Hangbin Liu
2019-12-20  3:25       ` [PATCHv4 net 2/8] ip6_gre: do not confirm neighbor when do pmtu update Hangbin Liu
2019-12-20  3:25       ` [PATCHv4 net 3/8] gtp: " Hangbin Liu
2019-12-21 18:35         ` Guillaume Nault
2019-12-20  3:25       ` [PATCHv4 net 4/8] net/dst: add new function skb_dst_update_pmtu_no_confirm Hangbin Liu
2019-12-20  3:25       ` [PATCHv4 net 5/8] tunnel: do not confirm neighbor when do pmtu update Hangbin Liu
2019-12-21 18:43         ` Guillaume Nault
2019-12-20  3:25       ` [PATCHv4 net 6/8] vti: " Hangbin Liu
2019-12-21 18:30         ` Guillaume Nault
2019-12-20  3:25       ` [PATCHv4 net 7/8] sit: " Hangbin Liu
2019-12-20  3:25       ` [PATCHv4 net 8/8] net/dst: do not confirm neighbor for vxlan and geneve " Hangbin Liu
2019-12-21 18:38         ` Guillaume Nault
2019-12-20 16:14       ` [PATCHv4 net 0/8] disable neigh update for tunnels during " David Ahern
2019-12-22  2:51       ` [PATCHv5 " Hangbin Liu
2019-12-22  2:51         ` [PATCHv5 net 1/8] net: add bool confirm_neigh parameter for dst_ops.update_pmtu Hangbin Liu
2019-12-22  2:51         ` [PATCHv5 net 2/8] ip6_gre: do not confirm neighbor when do pmtu update Hangbin Liu
2019-12-22  2:51         ` [PATCHv5 net 3/8] gtp: " Hangbin Liu
2019-12-22  2:51         ` [PATCHv5 net 4/8] net/dst: add new function skb_dst_update_pmtu_no_confirm Hangbin Liu
2019-12-22  2:51         ` [PATCHv5 net 5/8] tunnel: do not confirm neighbor when do pmtu update Hangbin Liu
2019-12-22  2:51         ` [PATCHv5 net 6/8] vti: " Hangbin Liu
2019-12-22  2:51         ` [PATCHv5 net 7/8] sit: " Hangbin Liu
2019-12-22  2:51         ` [PATCHv5 net 8/8] net/dst: do not confirm neighbor for vxlan and geneve " Hangbin Liu
2019-12-22 22:10         ` [PATCHv5 net 0/8] disable neigh update for tunnels during " Guillaume Nault
2019-12-25  6:30         ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).