From 8ad5643abe59d1f60b6efcdd61fe4f9195b2dde8 Mon Sep 17 00:00:00 2001 From: Donald Sharp Date: Thu, 29 Aug 2024 18:10:30 -0400 Subject: [PATCH] zebra: Convince SA that the ng will always be valid There is a code path that could theoretically get you to a point where the ng->nexthop is a NULL value. Let's just make sure the SA system believes that cannot happen anymore. Signed-off-by: Donald Sharp --- zebra/zebra_rib.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/zebra/zebra_rib.c b/zebra/zebra_rib.c index b4baee148aef..de8af3c9dfb8 100644 --- a/zebra/zebra_rib.c +++ b/zebra/zebra_rib.c @@ -4413,7 +4413,8 @@ int rib_add_multipath(afi_t afi, safi_t safi, struct prefix *p, return -1; } - if (ifp->ifindex == ng->nexthop->ifindex) + if (ng && ng->nexthop && + ifp->ifindex == ng->nexthop->ifindex) re->type = ZEBRA_ROUTE_CONNECT; } }