All of lore.kernel.org
 help / color / mirror / Atom feed
* Patch for MTU in the routing table cache
@ 2012-03-02 13:13 Simeon Penev
  2012-03-02 13:43 ` Eric Dumazet
  0 siblings, 1 reply; 4+ messages in thread
From: Simeon Penev @ 2012-03-02 13:13 UTC (permalink / raw)
  To: netdev

[-- 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;
 }
 

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2012-03-02 14:27 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-03-02 13:13 Patch for MTU in the routing table cache Simeon Penev
2012-03-02 13:43 ` Eric Dumazet
2012-03-02 13:49   ` Simeon Penev
2012-03-02 14:27     ` Eric Dumazet

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.