Skip to content

Commit 164a5e7

Browse files
edumazetdavem330
authored andcommitted
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 <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 520d0d7 commit 164a5e7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

net/ipv4/route.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1250,7 +1250,7 @@ static void set_class_tag(struct rtable *rt, u32 tag)
12501250
static unsigned int ipv4_default_advmss(const struct dst_entry *dst)
12511251
{
12521252
unsigned int header_size = sizeof(struct tcphdr) + sizeof(struct iphdr);
1253-
unsigned int advmss = max_t(unsigned int, dst->dev->mtu - header_size,
1253+
unsigned int advmss = max_t(unsigned int, ipv4_mtu(dst) - header_size,
12541254
ip_rt_min_advmss);
12551255

12561256
return min(advmss, IPV4_MAX_PMTU - header_size);

0 commit comments

Comments
 (0)