From a9c16a0a8993198cddd3613d6f80d45c49cecdf7 Mon Sep 17 00:00:00 2001 From: Donald Sharp Date: Tue, 5 Mar 2024 10:37:48 -0500 Subject: [PATCH] bgpd: pi->attr is deref'ed in all paths leading up to test In make_prefix, the code checks to see if the pi->attr is non-NULL. Since (A) we cannot have a path_info without an attribute and (B) all paths leading up to the test in make_prefix already have pi->attr deref'ed and the code is not crashing we know this is safe to remove. 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 fa566f0433..786d07c5a9 100644 --- a/bgpd/bgp_nht.c +++ b/bgpd/bgp_nht.c @@ -1057,7 +1057,7 @@ static int make_prefix(int afi, struct bgp_path_info *pi, struct prefix *p) break; case AFI_IP6: p->family = AF_INET6; - if (pi->attr && pi->attr->srv6_l3vpn) { + if (pi->attr->srv6_l3vpn) { IPV6_ADDR_COPY(&(p->u.prefix6), &(pi->attr->srv6_l3vpn->sid)); p->prefixlen = IPV6_MAX_BITLEN; -- 2.39.5