netdev.vger.kernel.org archive mirror
 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

* Re: Patch for MTU in the routing table cache
  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
  0 siblings, 1 reply; 4+ messages in thread
From: Eric Dumazet @ 2012-03-02 13:43 UTC (permalink / raw)
  To: Simeon Penev; +Cc: netdev

Le vendredi 02 mars 2012 à 14:13 +0100, Simeon Penev a écrit :
> 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.
> 

Hi

Did you test this patch doesnt break things like

ip ro add 96.17.148.89 via 10.0.0.1 mtu 800

(and keep eth0 mtu being standard mtu)

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

* Re: Patch for MTU in the routing table cache
  2012-03-02 13:43 ` Eric Dumazet
@ 2012-03-02 13:49   ` Simeon Penev
  2012-03-02 14:27     ` Eric Dumazet
  0 siblings, 1 reply; 4+ messages in thread
From: Simeon Penev @ 2012-03-02 13:49 UTC (permalink / raw)
  To: Eric Dumazet; +Cc: netdev

Hi Eric,

no, i didn't. I'm new to the developer list and just wanted to post a 
patch proposition. I hoped that the maintainer of the code (probably 
Alan Cox) will decide whether to use it.

Best regards,
Simeon

On 03/02/2012 02:43 PM, Eric Dumazet wrote:
> Le vendredi 02 mars 2012 à 14:13 +0100, Simeon Penev a écrit :
>> 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.
>>
> Hi
>
> Did you test this patch doesnt break things like
>
> ip ro add 96.17.148.89 via 10.0.0.1 mtu 800
>
> (and keep eth0 mtu being standard mtu)
>
>
>
>

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

* Re: Patch for MTU in the routing table cache
  2012-03-02 13:49   ` Simeon Penev
@ 2012-03-02 14:27     ` Eric Dumazet
  0 siblings, 0 replies; 4+ messages in thread
From: Eric Dumazet @ 2012-03-02 14:27 UTC (permalink / raw)
  To: Simeon Penev; +Cc: netdev

Le vendredi 02 mars 2012 à 14:49 +0100, Simeon Penev a écrit :
> Hi Eric,
> 
> no, i didn't. I'm new to the developer list and just wanted to post a 
> patch proposition. I hoped that the maintainer of the code (probably 
> Alan Cox) will decide whether to use it.
> 

David Miller is the current network maintainer, but thats not the
point :)

I didnt test your patch, all I wanted to say is that you cant assume all
routes share the same MTU (device MTU)

And this is the assumption you coded :

if (mtu && rt_is_output_route(rt) && mtu == dst->dev->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 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).