summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Jakma <paul.jakma@sun.com>2006-05-12 23:27:30 +0000
committerPaul Jakma <paul.jakma@sun.com>2006-05-12 23:27:30 +0000
commitdd8103a917c356abfdd166879186df2e5d1ca95a (patch)
tree03319c6b4338b847ad244c3e88dbddb7e6c12f16
parent34c3f81b542c7f91fa04a43f7d0a8a4482f22d4d (diff)
[bgpd] CID #7, remove useless NULL check, bgp_static_update_main
2006-05-12 Paul Jakma <paul.jakma@sun.com> * bgp_route.c: (bgp_static_update_main) Remove useless NULL check, code already assumes bgp_static can not be NULL, fixes CID #7.
-rw-r--r--bgpd/ChangeLog3
-rw-r--r--bgpd/bgp_route.c14
2 files changed, 11 insertions, 6 deletions
diff --git a/bgpd/ChangeLog b/bgpd/ChangeLog
index 437d51cd..0b500158 100644
--- a/bgpd/ChangeLog
+++ b/bgpd/ChangeLog
@@ -2,6 +2,9 @@
* bgp_attr.c: (bgp_packet_attribute) Remove dead code, Coverity
CID #1
+ * bgp_route.c: (bgp_static_update_main) Remove useless NULL
+ check, code already assumes bgp_static can not be NULL,
+ fixes CID #7.
2006-05-08 Paul Jakma <paul.jakma@sun.com>
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)