summaryrefslogtreecommitdiffstats
path: root/net/ipv4/route.c
diff options
context:
space:
mode:
authorEric Dumazet2017-10-19 02:02:03 +0200
committerDavid S. Miller2017-10-21 02:55:05 +0200
commit164a5e7ad531e181334a3d3f03d0d5ad20d6faea (patch)
tree5d78b377974176cc696dafd4c76e5defec13e0a6 /net/ipv4/route.c
parentMerge branch 'ieee802154-for-davem-2017-10-18' of git://git.kernel.org/pub/sc... (diff)
downloadkernel-qcow2-linux-164a5e7ad531e181334a3d3f03d0d5ad20d6faea.tar.gz
kernel-qcow2-linux-164a5e7ad531e181334a3d3f03d0d5ad20d6faea.tar.xz
kernel-qcow2-linux-164a5e7ad531e181334a3d3f03d0d5ad20d6faea.zip
ipv4: ipv4_default_advmss() should use route mtu
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> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/route.c')
-rw-r--r--net/ipv4/route.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/ipv4/route.c b/net/ipv4/route.c
index 4306db827374..bc40bd411196 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);