summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@cumulusnetworks.com>2019-02-25 14:10:10 -0500
committerDonald Sharp <sharpd@cumulusnetworks.com>2019-02-25 14:15:30 -0500
commitf4aaa447324c02a501fe8b2bbb48bc817d764220 (patch)
tree5386688c46aa382b4b9d17fd20fa2219c147f541
parentbf99288b5186480d1a3f6565509fca97c289c66f (diff)
ospfd: Allow pre-existing vrf's to work
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>
-rw-r--r--ospfd/ospfd.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/ospfd/ospfd.c b/ospfd/ospfd.c
index a18e2de725..073a51561b 100644
--- a/ospfd/ospfd.c
+++ b/ospfd/ospfd.c
@@ -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)