diff options
Diffstat (limited to 'eigrpd/eigrp_northbound.c')
-rw-r--r-- | eigrpd/eigrp_northbound.c | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/eigrpd/eigrp_northbound.c b/eigrpd/eigrp_northbound.c index 5eecc3332..4ccce2ebb 100644 --- a/eigrpd/eigrp_northbound.c +++ b/eigrpd/eigrp_northbound.c @@ -79,14 +79,18 @@ static int eigrpd_instance_create(enum nb_event event, union nb_resource *resource) { struct eigrp *eigrp; + const char *vrf; + vrf_id_t vrfid; switch (event) { case NB_EV_VALIDATE: /* NOTHING */ break; case NB_EV_PREPARE: - eigrp = eigrp_get(yang_dnode_get_string(dnode, "./asn"), - VRF_DEFAULT); + vrf = yang_dnode_get_string(dnode, "./vrf"); + vrfid = vrf_name_to_id(vrf); + + eigrp = eigrp_get(yang_dnode_get_uint16(dnode, "./asn"), vrfid); resource->ptr = eigrp; break; case NB_EV_ABORT: @@ -1185,8 +1189,8 @@ static int lib_interface_eigrp_instance_create(enum nb_event event, break; } - eigrp = eigrp_get(yang_dnode_get_string(dnode, "./asn"), - VRF_DEFAULT); + eigrp = eigrp_get(yang_dnode_get_uint16(dnode, "./asn"), + ifp->vrf_id); eif = eigrp_interface_lookup(eigrp, ifp->name); if (eif == NULL) return NB_ERR_INCONSISTENCY; @@ -1197,8 +1201,8 @@ static int lib_interface_eigrp_instance_create(enum nb_event event, break; case NB_EV_APPLY: ifp = nb_running_get_entry(dnode, NULL, true); - eigrp = eigrp_get(yang_dnode_get_string(dnode, "./asn"), - VRF_DEFAULT); + eigrp = eigrp_get(yang_dnode_get_uint16(dnode, "./asn"), + ifp->vrf_id); eif = eigrp_interface_lookup(eigrp, ifp->name); if (eif == NULL) return NB_ERR_INCONSISTENCY; |