From dd8103a917c356abfdd166879186df2e5d1ca95a Mon Sep 17 00:00:00 2001 From: Paul Jakma Date: Fri, 12 May 2006 23:27:30 +0000 Subject: [bgpd] CID #7, remove useless NULL check, bgp_static_update_main 2006-05-12 Paul Jakma * bgp_route.c: (bgp_static_update_main) Remove useless NULL check, code already assumes bgp_static can not be NULL, fixes CID #7. --- bgpd/bgp_route.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'bgpd/bgp_route.c') diff --git a/bgpd/bgp_route.c b/bgpd/bgp_route.c index f5d69e88..385198e2 100644 --- a/bgpd/bgp_route.c +++ b/bgpd/bgp_route.c @@ -3073,15 +3073,17 @@ bgp_static_update_main (struct bgp *bgp, struct prefix *p, struct attr *attr_new; int ret; + assert (bgp_static); + if (!bgp_static) + return; + rn = bgp_afi_node_get (bgp->rib[afi][safi], afi, safi, p, NULL); bgp_attr_default_set (&attr, BGP_ORIGIN_IGP); - if (bgp_static) - { - attr.nexthop = bgp_static->igpnexthop; - attr.med = bgp_static->igpmetric; - attr.flag |= ATTR_FLAG_BIT (BGP_ATTR_MULTI_EXIT_DISC); - } + + attr.nexthop = bgp_static->igpnexthop; + attr.med = bgp_static->igpmetric; + attr.flag |= ATTR_FLAG_BIT (BGP_ATTR_MULTI_EXIT_DISC); /* Apply route-map. */ if (bgp_static->rmap.name) -- cgit v1.2.1