Patch for MTU in the routing table cache
Subsystems (3)
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
net/ipv4/route.c renamed from net/ipv4/route.c.orig +3 -1
@@ -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; }
Quoted 7 lines · Simeon Penev
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)
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
Quoted 19 lines · Eric Dumazet
Quoted 7 lines · Simeon Penev
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)
Quoted 6 lines · Simeon Penev
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;