netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/5] route: Use the device mtu as the default for blackhole routes
@ 2011-11-23 12:12 Steffen Klassert
  2011-11-23 12:12 ` [PATCH 2/5] net: Rename the dst_opt default_mtu method to mtu Steffen Klassert
                   ` (3 more replies)
  0 siblings, 4 replies; 12+ messages in thread
From: Steffen Klassert @ 2011-11-23 12:12 UTC (permalink / raw)
  To: David Miller; +Cc: netdev

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>
---
 net/ipv4/route.c |    2 +-
 net/ipv6/route.c |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/net/ipv4/route.c b/net/ipv4/route.c
index 0c74da8..5b17bf1 100644
--- a/net/ipv4/route.c
+++ b/net/ipv4/route.c
@@ -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)
diff --git a/net/ipv6/route.c b/net/ipv6/route.c
index 8473016..d8fbd18 100644
--- a/net/ipv6/route.c
+++ b/net/ipv6/route.c
@@ -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)
-- 
1.7.0.4

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

end of thread, other threads:[~2011-11-24 12:06 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-11-23 12:12 [PATCH 1/5] route: Use the device mtu as the default for blackhole routes Steffen Klassert
2011-11-23 12:12 ` [PATCH 2/5] net: Rename the dst_opt default_mtu method to mtu Steffen Klassert
2011-11-23 12:13 ` [PATCH 3/5] net: Move mtu handling down to the protocol depended handlers Steffen Klassert
2011-11-23 12:14 ` [PATCH 4/5] route: struct rtable can be const in rt_is_input_route and rt_is_output_route Steffen Klassert
2011-11-23 12:14 ` [PATCH 5/5] ipv4: Don't use the cached pmtu informations for input routes Steffen Klassert
2011-11-23 15:52   ` Herbert Xu
2011-11-23 21:49     ` David Miller
2011-11-24  0:10       ` Herbert Xu
2011-11-24  0:17         ` David Miller
2011-11-24  1:01           ` Herbert Xu
2011-11-24  8:49             ` Steffen Klassert
2011-11-24 12:06               ` Herbert Xu

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).