]> git.puffer.fish Git - mirror/frr.git/commitdiff
[bgpd] CID #7, remove useless NULL check, bgp_static_update_main
authorPaul Jakma <paul.jakma@sun.com>
Fri, 12 May 2006 23:27:30 +0000 (23:27 +0000)
committerPaul Jakma <paul.jakma@sun.com>
Fri, 12 May 2006 23:27:30 +0000 (23:27 +0000)
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.

bgpd/ChangeLog
bgpd/bgp_route.c

index 437d51cd8c0ad93f10335e308414c1ff42469b73..0b500158e302e1ff25ee3d831038d01ab3e9de6f 100644 (file)
@@ -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>
 
index f5d69e887a60a86ca5a5153edd75253720c3fbfb..385198e23e2286ceedabd6a73ad48750e988b519 100644 (file)
@@ -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)