Skip to content

Commit 6b600b2

Browse files
klassertdavem330
authored andcommitted
route: Use the device mtu as the default for blackhole routes
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>
1 parent df07a94 commit 6b600b2

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

‎net/ipv4/route.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2757,7 +2757,7 @@ static struct dst_entry *ipv4_blackhole_dst_check(struct dst_entry *dst, u32 coo
27572757

27582758
static unsigned int ipv4_blackhole_default_mtu(const struct dst_entry *dst)
27592759
{
2760-
return 0;
2760+
return dst->dev->mtu;
27612761
}
27622762

27632763
static void ipv4_rt_blackhole_update_pmtu(struct dst_entry *dst, u32 mtu)

‎net/ipv6/route.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ static struct dst_ops ip6_dst_ops_template = {
157157

158158
static unsigned int ip6_blackhole_default_mtu(const struct dst_entry *dst)
159159
{
160-
return 0;
160+
return dst->dev->mtu;
161161
}
162162

163163
static void ip6_rt_blackhole_update_pmtu(struct dst_entry *dst, u32 mtu)

0 commit comments

Comments
 (0)