From: Eric Dumazet Date: Thu, 19 Oct 2017 00:02:03 +0000 (-0700) Subject: ipv4: ipv4_default_advmss() should use route mtu X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=fdfcb06c5944afb78007cfc25e527ff689b2a344;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git ipv4: ipv4_default_advmss() should use route mtu [ Upstream commit 164a5e7ad531e181334a3d3f03d0d5ad20d6faea ] 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 Signed-off-by: David S. Miller Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- diff --git a/net/ipv4/route.c b/net/ipv4/route.c index 647cfc972bde..804bead564db 100644 --- a/net/ipv4/route.c +++ b/net/ipv4/route.c @@ -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) { 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);