Skip to content

Commit

Permalink
route: Use the device mtu as the default for blackhole routes
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
klassert authored and davem330 committed Nov 26, 2011
1 parent df07a94 commit 6b600b2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion net/ipv4/route.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion net/ipv6/route.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 6b600b2

Please sign in to comment.