Skip to content

Commit ae2688d

Browse files
Jianzhao Wangdavem330
authored andcommitted
net: blackhole route should always be recalculated
Blackhole routes are used when xfrm_lookup() returns -EREMOTE (error triggered by IKE for example), hence this kind of route is always temporary and so we should check if a better route exists for next packets. Bug has been introduced by commit d11a4dc. Signed-off-by: Jianzhao Wang <jianzhao.wang@6wind.com> Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent f6b085b commit ae2688d

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

net/ipv4/route.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2738,6 +2738,11 @@ int __ip_route_output_key(struct net *net, struct rtable **rp,
27382738
}
27392739
EXPORT_SYMBOL_GPL(__ip_route_output_key);
27402740

2741+
static struct dst_entry *ipv4_blackhole_dst_check(struct dst_entry *dst, u32 cookie)
2742+
{
2743+
return NULL;
2744+
}
2745+
27412746
static void ipv4_rt_blackhole_update_pmtu(struct dst_entry *dst, u32 mtu)
27422747
{
27432748
}
@@ -2746,7 +2751,7 @@ static struct dst_ops ipv4_dst_blackhole_ops = {
27462751
.family = AF_INET,
27472752
.protocol = cpu_to_be16(ETH_P_IP),
27482753
.destroy = ipv4_dst_destroy,
2749-
.check = ipv4_dst_check,
2754+
.check = ipv4_blackhole_dst_check,
27502755
.update_pmtu = ipv4_rt_blackhole_update_pmtu,
27512756
.entries = ATOMIC_INIT(0),
27522757
};

0 commit comments

Comments
 (0)