From: Simeon Penev <spenev@istac.de>
To: netdev@vger.kernel.org
Subject: Patch for MTU in the routing table cache
Date: Fri, 02 Mar 2012 14:13:45 +0100 [thread overview]
Message-ID: <4F50C789.8050709@istac.de> (raw)
[-- Attachment #1: Type: text/plain, Size: 303 bytes --]
Hi,
after testing the new 3.2 kernel and the new route caching code, i've
found a bug in net/ipv4/route.c. The route cache does not detect changes
to the MTU of the interface. Therefore IP fragmentation will happen with
false MTU. Please see attached the proposed patch.
Best regards,
Simeon Penev
[-- Attachment #2: route-cache-mtu.patch --]
[-- Type: text/x-patch, Size: 542 bytes --]
--- linux-3.2.7/net/ipv4/route.c.orig 2012-02-28 17:26:00.214386221 +0100
+++ linux-3.2.7/net/ipv4/route.c 2012-02-28 17:25:27.826225630 +0100
@@ -1926,7 +1926,7 @@
const struct rtable *rt = (const struct rtable *) dst;
unsigned int mtu = dst_metric_raw(dst, RTAX_MTU);
- if (mtu && rt_is_output_route(rt))
+ if (mtu && rt_is_output_route(rt) && mtu == dst->dev->mtu)
return mtu;
mtu = dst->dev->mtu;
@@ -1940,6 +1940,8 @@
if (mtu > IP_MAX_MTU)
mtu = IP_MAX_MTU;
+ dst_metric_set(dst, RTAX_MTU, mtu);
+
return mtu;
}
next reply other threads:[~2012-03-02 13:32 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-03-02 13:13 Simeon Penev [this message]
2012-03-02 13:43 ` Patch for MTU in the routing table cache Eric Dumazet
2012-03-02 13:49 ` Simeon Penev
2012-03-02 14:27 ` Eric Dumazet
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4F50C789.8050709@istac.de \
--to=spenev@istac.de \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).