]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
ipv4: lock mtu in fnhe when received PMTU < net.ipv4.route.min_pmtu
authorSabrina Dubroca <sd@queasysnail.net>
Wed, 14 Mar 2018 09:21:14 +0000 (10:21 +0100)
committerKleber Sacilotto de Souza <kleber.souza@canonical.com>
Mon, 27 Aug 2018 14:40:05 +0000 (16:40 +0200)
commita9f829f7f8a58861cd258368482fae664b4484b3
treeaf41ab98a8ce8bacbe3fa8b2d281ee94705e35d6
parentd82ab4df585550fc7b38148d74583a86d545ad6d
ipv4: lock mtu in fnhe when received PMTU < net.ipv4.route.min_pmtu

BugLink: http://bugs.launchpad.net/bugs/1786352
[ Upstream commit d52e5a7e7ca49457dd31fc8b42fb7c0d58a31221 ]

Prior to the rework of PMTU information storage in commit
2c8cec5c10bc ("ipv4: Cache learned PMTU information in inetpeer."),
when a PMTU event advertising a PMTU smaller than
net.ipv4.route.min_pmtu was received, we would disable setting the DF
flag on packets by locking the MTU metric, and set the PMTU to
net.ipv4.route.min_pmtu.

Since then, we don't disable DF, and set PMTU to
net.ipv4.route.min_pmtu, so the intermediate router that has this link
with a small MTU will have to drop the packets.

This patch reestablishes pre-2.6.39 behavior by splitting
rtable->rt_pmtu into a bitfield with rt_mtu_locked and rt_pmtu.
rt_mtu_locked indicates that we shouldn't set the DF bit on that path,
and is checked in ip_dont_fragment().

One possible workaround is to set net.ipv4.route.min_pmtu to a value low
enough to accommodate the lowest MTU encountered.

Fixes: 2c8cec5c10bc ("ipv4: Cache learned PMTU information in inetpeer.")
Signed-off-by: Sabrina Dubroca <sd@queasysnail.net>
Reviewed-by: Stefano Brivio <sbrivio@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
include/net/ip.h
include/net/ip_fib.h
include/net/route.h
net/ipv4/route.c
net/ipv4/xfrm4_policy.c