]> git.puffer.fish Git - mirror/frr.git/commitdiff
ospfd: Allow pre-existing vrf's to work 3867/head
authorDonald Sharp <sharpd@cumulusnetworks.com>
Mon, 25 Feb 2019 19:10:10 +0000 (14:10 -0500)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Mon, 25 Feb 2019 19:15:30 +0000 (14:15 -0500)
When creating a ospf vrf based instance allow it to work
if the vrf has been created *before* we create the ospf
instance.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
ospfd/ospfd.c

index a18e2de72511b7d14429489e376ba4f8fd98be84..073a51561b34e8fb75912de8331be964a528718d 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)