Commit fdfcb06c authored by Eric Dumazet's avatar Eric Dumazet Committed by Greg Kroah-Hartman

ipv4: ipv4_default_advmss() should use route mtu


[ Upstream commit 164a5e7a ]

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: default avatarEric Dumazet <edumazet@google.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
Signed-off-by: default avatarSasha Levin <alexander.levin@verizon.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 48185ffb
...@@ -1254,7 +1254,7 @@ static void set_class_tag(struct rtable *rt, u32 tag) ...@@ -1254,7 +1254,7 @@ static void set_class_tag(struct rtable *rt, u32 tag)
static unsigned int ipv4_default_advmss(const struct dst_entry *dst) static unsigned int ipv4_default_advmss(const struct dst_entry *dst)
{ {
unsigned int header_size = sizeof(struct tcphdr) + sizeof(struct iphdr); 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); ip_rt_min_advmss);
return min(advmss, IPV4_MAX_PMTU - header_size); return min(advmss, IPV4_MAX_PMTU - header_size);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment