Skip to content

Commit f4aaa44

Browse files
committed
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>
1 parent bf99288 commit f4aaa44

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

ospfd/ospfd.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -234,8 +234,12 @@ static struct ospf *ospf_new(unsigned short instance, const char *name)
234234
new->instance = instance;
235235
new->router_id.s_addr = htonl(0);
236236
new->router_id_static.s_addr = htonl(0);
237-
if (name && !strmatch(name, VRF_DEFAULT_NAME)) {
238-
new->vrf_id = VRF_UNKNOWN;
237+
if (name) {
238+
vrf = vrf_lookup_by_name(name);
239+
if (vrf)
240+
new->vrf_id = vrf->vrf_id;
241+
else
242+
new->vrf_id = VRF_UNKNOWN;
239243
/* Freed in ospf_finish_final */
240244
new->name = XSTRDUP(MTYPE_OSPF_TOP, name);
241245
if (IS_DEBUG_OSPF_EVENT)

0 commit comments

Comments
 (0)