]> git.puffer.fish Git - mirror/frr.git/commitdiff
zebra: Convince SA that the ng will always be valid 16692/head
authorDonald Sharp <sharpd@nvidia.com>
Thu, 29 Aug 2024 22:10:30 +0000 (18:10 -0400)
committerDonald Sharp <sharpd@nvidia.com>
Thu, 29 Aug 2024 22:10:30 +0000 (18:10 -0400)
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 <sharpd@nvidia.com>
zebra/zebra_rib.c

index b4baee148aef6b11787808c8f307fac41f1de315..de8af3c9dfb8bc2dafcbeb79ef5f43192695b49a 100644 (file)
@@ -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;
                }
        }