]> Pileus Git - ~andy/linux/commitdiff
route: Use the device mtu as the default for blackhole routes
authorSteffen Klassert <steffen.klassert@secunet.com>
Wed, 23 Nov 2011 02:12:13 +0000 (02:12 +0000)
committerDavid S. Miller <davem@davemloft.net>
Sat, 26 Nov 2011 19:29:50 +0000 (14:29 -0500)
As it is, we return null as the default mtu of blackhole routes.
This may lead to a propagation of a bogus pmtu if the default_mtu
method of a blackhole route is invoked. So return dst->dev->mtu
as the default mtu instead.

Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv4/route.c
net/ipv6/route.c

index 0c74da8a04732ce9702e9c1c8d80496f1c8df423..5b17bf124a333cc00af573f590a64492c4f411ce 100644 (file)
@@ -2757,7 +2757,7 @@ static struct dst_entry *ipv4_blackhole_dst_check(struct dst_entry *dst, u32 coo
 
 static unsigned int ipv4_blackhole_default_mtu(const struct dst_entry *dst)
 {
-       return 0;
+       return dst->dev->mtu;
 }
 
 static void ipv4_rt_blackhole_update_pmtu(struct dst_entry *dst, u32 mtu)
index 8473016bba4a8cd6ae4dfc420c7827524fc3a84b..d8fbd18c94671c1295e394bbba29b1152727c3a4 100644 (file)
@@ -157,7 +157,7 @@ static struct dst_ops ip6_dst_ops_template = {
 
 static unsigned int ip6_blackhole_default_mtu(const struct dst_entry *dst)
 {
-       return 0;
+       return dst->dev->mtu;
 }
 
 static void ip6_rt_blackhole_update_pmtu(struct dst_entry *dst, u32 mtu)