Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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

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>

authored by

Jianzhao Wang and committed by
David S. Miller
ae2688d5 f6b085b6

+6 -1
+6 -1
net/ipv4/route.c
··· 2738 2738 } 2739 2739 EXPORT_SYMBOL_GPL(__ip_route_output_key); 2740 2740 2741 + static struct dst_entry *ipv4_blackhole_dst_check(struct dst_entry *dst, u32 cookie) 2742 + { 2743 + return NULL; 2744 + } 2745 + 2741 2746 static void ipv4_rt_blackhole_update_pmtu(struct dst_entry *dst, u32 mtu) 2742 2747 { 2743 2748 } ··· 2751 2746 .family = AF_INET, 2752 2747 .protocol = cpu_to_be16(ETH_P_IP), 2753 2748 .destroy = ipv4_dst_destroy, 2754 - .check = ipv4_dst_check, 2749 + .check = ipv4_blackhole_dst_check, 2755 2750 .update_pmtu = ipv4_rt_blackhole_update_pmtu, 2756 2751 .entries = ATOMIC_INIT(0), 2757 2752 };