netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net] ipv4: reset fnhe_mtu_locked after cache route flushed
@ 2018-05-09 10:06 Hangbin Liu
  2018-05-10 19:43 ` David Miller
  0 siblings, 1 reply; 4+ messages in thread
From: Hangbin Liu @ 2018-05-09 10:06 UTC (permalink / raw)
  To: netdev; +Cc: Sabrina Dubroca, Stefano Brivio, Hangbin Liu

After route cache is flushed via ipv4_sysctl_rtcache_flush(), we forget
to reset fnhe_mtu_locked in rt_bind_exception(). When pmtu is updated
in __ip_rt_update_pmtu(), it will return directly since the pmtu is
still locked. e.g.

+ ip netns exec client ping 10.10.1.1 -c 1 -s 1400 -M do
PING 10.10.1.1 (10.10.1.1) 1400(1428) bytes of data.
>From 10.10.0.254 icmp_seq=1 Frag needed and DF set (mtu = 0)

--- 10.10.1.1 ping statistics ---
1 packets transmitted, 0 received, +1 errors, 100% packet loss, time 0ms

+ ip netns exec client ip route get 10.10.1.1
10.10.1.1 via 10.10.0.254 dev veth0_c src 10.10.0.1 uid 0
    cache expires 599sec mtu lock 552
+ ip netns exec client ip route flush cache
+ ip netns exec client ip route get 10.10.1.1
10.10.1.1 via 10.10.0.254 dev veth0_c src 10.10.0.1 uid 0
    cache
+ ip netns exec client ping 10.10.1.1 -c 1 -s 1400 -M do
PING 10.10.1.1 (10.10.1.1) 1400(1428) bytes of data.
ping: local error: Message too long, mtu=576

--- 10.10.1.1 ping statistics ---
1 packets transmitted, 0 received, +1 errors, 100% packet loss, time 0ms

+ ip netns exec client ip route get 10.10.1.1
10.10.1.1 via 10.10.0.254 dev veth0_c src 10.10.0.1 uid 0
    cache

Fixes: d52e5a7e7ca49 ("ipv4: lock mtu in fnhe when received PMTU < net.ipv4.route.min_pmtu")
Reported-by: Jianlin Shi <jishi@redhat.com>
Reviewed-by: Stefano Brivio <sbrivio@redhat.com>
Signed-off-by: Hangbin Liu <liuhangbin@gmail.com>
---
 net/ipv4/route.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/net/ipv4/route.c b/net/ipv4/route.c
index 1412a7b..29268ef 100644
--- a/net/ipv4/route.c
+++ b/net/ipv4/route.c
@@ -1375,6 +1375,7 @@ static bool rt_bind_exception(struct rtable *rt, struct fib_nh_exception *fnhe,
 			fnhe->fnhe_gw = 0;
 			fnhe->fnhe_pmtu = 0;
 			fnhe->fnhe_expires = 0;
+			fnhe->fnhe_mtu_locked = false;
 			fnhe_flush_routes(fnhe);
 			orig = NULL;
 		}
-- 
2.5.5

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

* Re: [PATCH net] ipv4: reset fnhe_mtu_locked after cache route flushed
  2018-05-09 10:06 [PATCH net] ipv4: reset fnhe_mtu_locked after cache route flushed Hangbin Liu
@ 2018-05-10 19:43 ` David Miller
  2018-07-10 14:00   ` Sabrina Dubroca
  0 siblings, 1 reply; 4+ messages in thread
From: David Miller @ 2018-05-10 19:43 UTC (permalink / raw)
  To: liuhangbin; +Cc: netdev, sd, sbrivio

From: Hangbin Liu <liuhangbin@gmail.com>
Date: Wed,  9 May 2018 18:06:44 +0800

> After route cache is flushed via ipv4_sysctl_rtcache_flush(), we forget
> to reset fnhe_mtu_locked in rt_bind_exception(). When pmtu is updated
> in __ip_rt_update_pmtu(), it will return directly since the pmtu is
> still locked. e.g.
> 
> + ip netns exec client ping 10.10.1.1 -c 1 -s 1400 -M do
> PING 10.10.1.1 (10.10.1.1) 1400(1428) bytes of data.
> From 10.10.0.254 icmp_seq=1 Frag needed and DF set (mtu = 0)
> 
> --- 10.10.1.1 ping statistics ---
> 1 packets transmitted, 0 received, +1 errors, 100% packet loss, time 0ms
> 
> + ip netns exec client ip route get 10.10.1.1
> 10.10.1.1 via 10.10.0.254 dev veth0_c src 10.10.0.1 uid 0
>     cache expires 599sec mtu lock 552
> + ip netns exec client ip route flush cache
> + ip netns exec client ip route get 10.10.1.1
> 10.10.1.1 via 10.10.0.254 dev veth0_c src 10.10.0.1 uid 0
>     cache
> + ip netns exec client ping 10.10.1.1 -c 1 -s 1400 -M do
> PING 10.10.1.1 (10.10.1.1) 1400(1428) bytes of data.
> ping: local error: Message too long, mtu=576
> 
> --- 10.10.1.1 ping statistics ---
> 1 packets transmitted, 0 received, +1 errors, 100% packet loss, time 0ms
> 
> + ip netns exec client ip route get 10.10.1.1
> 10.10.1.1 via 10.10.0.254 dev veth0_c src 10.10.0.1 uid 0
>     cache
> 
> Fixes: d52e5a7e7ca49 ("ipv4: lock mtu in fnhe when received PMTU < net.ipv4.route.min_pmtu")
> Reported-by: Jianlin Shi <jishi@redhat.com>
> Reviewed-by: Stefano Brivio <sbrivio@redhat.com>
> Signed-off-by: Hangbin Liu <liuhangbin@gmail.com>

Applied.

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

* Re: [PATCH net] ipv4: reset fnhe_mtu_locked after cache route flushed
  2018-05-10 19:43 ` David Miller
@ 2018-07-10 14:00   ` Sabrina Dubroca
  2018-07-10 16:49     ` David Miller
  0 siblings, 1 reply; 4+ messages in thread
From: Sabrina Dubroca @ 2018-07-10 14:00 UTC (permalink / raw)
  To: David Miller; +Cc: liuhangbin, netdev, sbrivio

2018-05-10, 15:43:11 -0400, David Miller wrote:
> From: Hangbin Liu <liuhangbin@gmail.com>
> Date: Wed,  9 May 2018 18:06:44 +0800
> 
> > After route cache is flushed via ipv4_sysctl_rtcache_flush(), we forget
> > to reset fnhe_mtu_locked in rt_bind_exception(). When pmtu is updated
> > in __ip_rt_update_pmtu(), it will return directly since the pmtu is
> > still locked. e.g.
> > 
> > + ip netns exec client ping 10.10.1.1 -c 1 -s 1400 -M do
> > PING 10.10.1.1 (10.10.1.1) 1400(1428) bytes of data.
> > From 10.10.0.254 icmp_seq=1 Frag needed and DF set (mtu = 0)
> > 
> > --- 10.10.1.1 ping statistics ---
> > 1 packets transmitted, 0 received, +1 errors, 100% packet loss, time 0ms
> > 
> > + ip netns exec client ip route get 10.10.1.1
> > 10.10.1.1 via 10.10.0.254 dev veth0_c src 10.10.0.1 uid 0
> >     cache expires 599sec mtu lock 552
> > + ip netns exec client ip route flush cache
> > + ip netns exec client ip route get 10.10.1.1
> > 10.10.1.1 via 10.10.0.254 dev veth0_c src 10.10.0.1 uid 0
> >     cache
> > + ip netns exec client ping 10.10.1.1 -c 1 -s 1400 -M do
> > PING 10.10.1.1 (10.10.1.1) 1400(1428) bytes of data.
> > ping: local error: Message too long, mtu=576
> > 
> > --- 10.10.1.1 ping statistics ---
> > 1 packets transmitted, 0 received, +1 errors, 100% packet loss, time 0ms
> > 
> > + ip netns exec client ip route get 10.10.1.1
> > 10.10.1.1 via 10.10.0.254 dev veth0_c src 10.10.0.1 uid 0
> >     cache
> > 
> > Fixes: d52e5a7e7ca49 ("ipv4: lock mtu in fnhe when received PMTU < net.ipv4.route.min_pmtu")
> > Reported-by: Jianlin Shi <jishi@redhat.com>
> > Reviewed-by: Stefano Brivio <sbrivio@redhat.com>
> > Signed-off-by: Hangbin Liu <liuhangbin@gmail.com>
> 
> Applied.

meh, I know it's way too late, but I just noticed this patch lost most
of its commit message, and all of its tags, when it went into git :(
Patchwork actually thinks the format is ok (it counts one Fixes and
one Reviewed-by), but git cut all that out.

Would there be a way to detect this when you apply patches? "there's
no tag above the first '^---', but there are some tags below it",
something like that?

commit 0e8411e426e277f55bd21e287ec89fab6f8eacae
Author: Hangbin Liu <liuhangbin@gmail.com>
Date:   Wed May 9 18:06:44 2018 +0800

    ipv4: reset fnhe_mtu_locked after cache route flushed
    
    After route cache is flushed via ipv4_sysctl_rtcache_flush(), we forget
    to reset fnhe_mtu_locked in rt_bind_exception(). When pmtu is updated
    in __ip_rt_update_pmtu(), it will return directly since the pmtu is
    still locked. e.g.
    
    + ip netns exec client ping 10.10.1.1 -c 1 -s 1400 -M do
    PING 10.10.1.1 (10.10.1.1) 1400(1428) bytes of data.
    >From 10.10.0.254 icmp_seq=1 Frag needed and DF set (mtu = 0)
    
    Signed-off-by: David S. Miller <davem@davemloft.net>

-- 
Sabrina

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

* Re: [PATCH net] ipv4: reset fnhe_mtu_locked after cache route flushed
  2018-07-10 14:00   ` Sabrina Dubroca
@ 2018-07-10 16:49     ` David Miller
  0 siblings, 0 replies; 4+ messages in thread
From: David Miller @ 2018-07-10 16:49 UTC (permalink / raw)
  To: sd; +Cc: liuhangbin, netdev, sbrivio

From: Sabrina Dubroca <sd@queasysnail.net>
Date: Tue, 10 Jul 2018 16:00:42 +0200

> Would there be a way to detect this when you apply patches? "there's
> no tag above the first '^---', but there are some tags below it",
> something like that?

Ugh, yeah ping's output format keeps biting us like this, sorry.

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

end of thread, other threads:[~2018-07-10 16:49 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-05-09 10:06 [PATCH net] ipv4: reset fnhe_mtu_locked after cache route flushed Hangbin Liu
2018-05-10 19:43 ` David Miller
2018-07-10 14:00   ` Sabrina Dubroca
2018-07-10 16:49     ` 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).