New: PMTU discovery no longer works in Linux 3.6+ with routers that do not send next hop MTU information
Subsystems (2)
Begin forwarded message:
Date: Wed, 27 Mar 2013 08:25:40 -0700
From: "[email protected]" <[email protected]>
To: "[email protected]" <[email protected]>
Subject: [Bug 55861] New: PMTU discovery no longer works in Linux 3.6+ with routers that do not send next hop MTU information
https://bugzilla.kernel.org/show_bug.cgi?id=55861
Summary: PMTU discovery no longer works in Linux 3.6+ with
routers that do not send next hop MTU information
Product: Networking
Version: 2.5
Kernel Version: 3.6 onwards
Platform: All
OS/Version: Linux
Tree: Mainline
Status: NEW
Severity: normal
Priority: P1
Component: IPV4
AssignedTo: [email protected]
ReportedBy: [email protected]
Regression: Yes
After upgrading recently, I found that path MTU discovery no longer worked correctly for accessing some devices on the other side of an IPsec tunnel.
Bisection revealed the problems started with 3.6 and are still present in 3.9-rc4 (latest available at time of reporting).
Some investigation into code changes leads me to the belief that Linux lost support for handling ICMP destination unreachable fragmentation needed packets for which the next hop MTU field is zero. This is an expected condition when dealing with older routers, as RFC792 originally defined ICMP destination unreachable fragmentation needed without a next hop MTU field, and it was later added in bytes previously allocated as unused.
The particular router in my case generating such packets is a machine running OpenBSD 4.6.
A commit that appears to be of particular interest in this bug is
https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=46517008e1168dc926cf2c47d529efc07eca85c0
Signature · 3 lines
Configure bugmail: https://bugzilla.kernel.org/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug.
It seems to be in icmp_unreach():
case ICMP_FRAG_NEEDED:
if (ipv4_config.no_pmtu_disc) {
LIMIT_NETDEBUG(KERN_INFO pr_fmt("%pI4: fragmentation needed and DF set\n"),
&iph->daddr);
} else {
info = ntohs(icmph->un.frag.mtu);
if (!info)
goto out;When MTU is zero, we skip the process in icmp_socket_deliver() which propagate this error to transport protocols.
After some investigation it seems in transport protocols' err_handler which finally called dst->update_pmtu(ip_rt_update_pmtu for IPv4) can deal with this situation properly.
So I think we can simply kill the check of icmph->un.frag.mtu here.
Quoted 48 lines · Stephen Hemminger
Begin forwarded message:
Date: Wed, 27 Mar 2013 08:25:40 -0700
From: "[email protected]" <[email protected]>
To: "[email protected]" <[email protected]>
Subject: [Bug 55861] New: PMTU discovery no longer works in Linux 3.6+ with routers that do not send next hop MTU informationhttps://bugzilla.kernel.org/show_bug.cgi?id=55861
Summary: PMTU discovery no longer works in Linux 3.6+ with
routers that do not send next hop MTU information
Product: Networking
Version: 2.5
Kernel Version: 3.6 onwards
Platform: All
OS/Version: Linux
Tree: Mainline
Status: NEW
Severity: normal
Priority: P1
Component: IPV4
AssignedTo: [email protected]
ReportedBy: [email protected]
Regression: YesAfter upgrading recently, I found that path MTU discovery no longer worked correctly for accessing some devices on the other side of an IPsec tunnel.
Bisection revealed the problems started with 3.6 and are still present in 3.9-rc4 (latest available at time of reporting).
Some investigation into code changes leads me to the belief that Linux lost support for handling ICMP destination unreachable fragmentation needed packets for which the next hop MTU field is zero. This is an expected condition when dealing with older routers, as RFC792 originally defined ICMP destination unreachable fragmentation needed without a next hop MTU field, and it was later added in bytes previously allocated as unused.
The particular router in my case generating such packets is a machine running OpenBSD 4.6.
A commit that appears to be of particular interest in this bug is
https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=46517008e1168dc926cf2c47d529efc07eca85c0
David Miller
maintainerFrom: Li Wei <[email protected]>
Date: Thu, 28 Mar 2013 09:59:04 +0800
Quoted 11 lines
It seems to be in
icmp_unreach():case ICMP_FRAG_NEEDED: if (ipv4_config.no_pmtu_disc) { LIMIT_NETDEBUG(KERN_INFO pr_fmt("%pI4: fragmentation needed and DF set\n"), &iph->daddr); } else { info = ntohs(icmph->un.frag.mtu); if (!info) goto out;
Quoted 2 lines
When MTU is zero, we skip the process in
icmp_socket_deliver()which propagate this error to transport protocols.
No, really, MTU field should not be set to zero. It should be set to the actual MTU value we should use.
If you remove this check then we'll go down to the ipv4 routing code and use the minimum ipv4 MTU, you absolutely do not want that.
The old code, that was removed, would try to guess in this case using a table, the guard for this code path had comment:
/* BSD 4.2 derived systems incorrectly adjust * tot_len by the IP header length, and report * a zero MTU in the ICMP message. */
So the machines sending these zero MTUs are very broken.
I'm not accomodating such broken systems, sorry.