]> git.proxmox.com Git - mirror_frr.git/blobdiff - ospfd/ospfd.c
Merge pull request #3888 from donaldsharp/ospf_cleanup
[mirror_frr.git] / ospfd / ospfd.c
index a18e2de72511b7d14429489e376ba4f8fd98be84..35c313e55543d3fa8aeeced8e73f665ffd5a1cb9 100644 (file)
@@ -234,8 +234,12 @@ static struct ospf *ospf_new(unsigned short instance, const char *name)
        new->instance = instance;
        new->router_id.s_addr = htonl(0);
        new->router_id_static.s_addr = htonl(0);
-       if (name && !strmatch(name, VRF_DEFAULT_NAME)) {
-               new->vrf_id = VRF_UNKNOWN;
+       if (name) {
+               vrf = vrf_lookup_by_name(name);
+               if (vrf)
+                       new->vrf_id = vrf->vrf_id;
+               else
+                       new->vrf_id = VRF_UNKNOWN;
                /* Freed in ospf_finish_final */
                new->name = XSTRDUP(MTYPE_OSPF_TOP, name);
                if (IS_DEBUG_OSPF_EVENT)
@@ -624,8 +628,10 @@ static void ospf_finish_final(struct ospf *ospf)
                if (!red_list)
                        continue;
 
-               for (ALL_LIST_ELEMENTS(red_list, node, nnode, red))
+               for (ALL_LIST_ELEMENTS(red_list, node, nnode, red)) {
                        ospf_redistribute_unset(ospf, i, red->instance);
+                       ospf_redist_del(ospf, i, red->instance);
+               }
        }
        ospf_redistribute_default_unset(ospf);
 
@@ -772,6 +778,8 @@ static void ospf_finish_final(struct ospf *ospf)
                                        rn->info = NULL;
                                        route_unlock_node(rn);
                                }
+
+                       ospf_external_del(ospf, i, ext->instance);
                }
        }