[PATCH net-next] ipv4: ipv4_default_advmss() should use route mtu

Subsystems: networking [general], networking [ipv4/ipv6], the rest

STALE3216d

2 messages, 2 authors, 2017-10-21 · open the first message on its own page

[PATCH net-next] ipv4: ipv4_default_advmss() should use route mtu

From: Eric Dumazet <hidden>
Date: 2017-10-19 00:02:05

From: Eric Dumazet <edumazet@google.com>

ipv4_default_advmss() incorrectly uses the device MTU instead
of the route provided one. IPv6 has the proper behavior,
lets harmonize the two protocols.

Signed-off-by: Eric Dumazet <edumazet@google.com>
---
 net/ipv4/route.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/ipv4/route.c b/net/ipv4/route.c
index 4306db8273742f5e845635419c296823301c4a8b..bc40bd4111969f640603dd7c5b04fdb7fdcd4afd 100644
--- a/net/ipv4/route.c
+++ b/net/ipv4/route.c
@@ -1250,7 +1250,7 @@ static void set_class_tag(struct rtable *rt, u32 tag)
 static unsigned int ipv4_default_advmss(const struct dst_entry *dst)
 {
 	unsigned int header_size = sizeof(struct tcphdr) + sizeof(struct iphdr);
-	unsigned int advmss = max_t(unsigned int, dst->dev->mtu - header_size,
+	unsigned int advmss = max_t(unsigned int, ipv4_mtu(dst) - header_size,
 				    ip_rt_min_advmss);
 
 	return min(advmss, IPV4_MAX_PMTU - header_size);

Re: [PATCH net-next] ipv4: ipv4_default_advmss() should use route mtu

From: David Miller <davem@davemloft.net>
Date: 2017-10-21 00:55:30

From: Eric Dumazet <redacted>
Date: Wed, 18 Oct 2017 17:02:03 -0700
From: Eric Dumazet <edumazet@google.com>

ipv4_default_advmss() incorrectly uses the device MTU instead
of the route provided one. IPv6 has the proper behavior,
lets harmonize the two protocols.

Signed-off-by: Eric Dumazet <edumazet@google.com>
Applied.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help