From e817f2ccbf9e4173d1a2cf404fe0fd41d6cd9bcd Mon Sep 17 00:00:00 2001 From: Donald Sharp Date: Thu, 18 Feb 2021 06:55:29 -0500 Subject: [PATCH] bgpd: Fix crash when we don't have a nexthop Recent changes to allow bgpd to handle v6 LL slightly differently in the nexthop tracking code has not interacted well with the blackhole nexthop change for peers. Modify the code to do the right thing Signed-off-by: Donald Sharp --- bgpd/bgp_nht.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bgpd/bgp_nht.c b/bgpd/bgp_nht.c index 3563f7e1a2..c6fa37fa8d 100644 --- a/bgpd/bgp_nht.c +++ b/bgpd/bgp_nht.c @@ -970,7 +970,7 @@ static void evaluate_paths(struct bgp_nexthop_cache *bnc) /* * Peering cannot occur across a blackhole nexthop */ - if (bnc->nexthop_num == 1 + if (bnc->nexthop_num == 1 && bnc->nexthop && bnc->nexthop->type == NEXTHOP_TYPE_BLACKHOLE) { peer->last_reset = PEER_DOWN_WAITING_NHT; valid_nexthops = 0; -- 2.39.5