]> git.proxmox.com Git - mirror_frr.git/commitdiff
eigrpd ospfd: null chk (Coverity 1458168 1455335)
authorpaco <paco@voltanet.io>
Mon, 25 Jun 2018 13:43:04 +0000 (15:43 +0200)
committerpaco <paco@voltanet.io>
Mon, 25 Jun 2018 14:37:04 +0000 (16:37 +0200)
Signed-off-by: F. Aragon <paco@voltanet.io>
eigrpd/eigrp_topology.c
ospfd/ospfd.c

index 4e26446ebe10419fdf4741332988142321117583..8ca0e282a8cdfb09814505934e8cd94e46fb3877 100644 (file)
@@ -448,6 +448,8 @@ void eigrp_topology_update_node_flags(struct eigrp_prefix_entry *dest)
        struct eigrp_nexthop_entry *entry;
        struct eigrp *eigrp = eigrp_lookup();
 
+       assert(eigrp);
+
        for (ALL_LIST_ELEMENTS_RO(dest->entries, node, entry)) {
                if (entry->reported_distance < dest->fdistance) {
                        // is feasible successor, can be successor
index 4cf38439c658e6efdefdc2de52cdd74d26574db2..f315421843ee1e9df1fd9e0e4c9042de1eaf21b7 100644 (file)
@@ -243,13 +243,14 @@ static struct ospf *ospf_new(unsigned short instance, const char *name)
                        zlog_debug(
                                "%s: Create new ospf instance with vrf_name %s vrf_id %u",
                                __PRETTY_FUNCTION__, name, new->vrf_id);
-               if (vrf)
-                       ospf_vrf_link(new, vrf);
        } else {
                new->vrf_id = VRF_DEFAULT;
                vrf = vrf_lookup_by_id(VRF_DEFAULT);
-               ospf_vrf_link(new, vrf);
        }
+
+       if (vrf)
+               ospf_vrf_link(new, vrf);
+
        ospf_zebra_vrf_register(new);
 
        new->abr_type = OSPF_ABR_DEFAULT;