From b4c41915a29f699da7a7b373f56e3adc0649563e Mon Sep 17 00:00:00 2001 From: Igor Ryzhov Date: Fri, 14 May 2021 01:41:27 +0300 Subject: [PATCH] Revert "bgpd: don't rely on northbound control plane protocol vrf pointer" This reverts commit 3fa607bebacd4881053414d641e8376b4e4f6e83. --- bgpd/bgp_nb_config.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/bgpd/bgp_nb_config.c b/bgpd/bgp_nb_config.c index 74b0f28eef..fda8a1c624 100644 --- a/bgpd/bgp_nb_config.c +++ b/bgpd/bgp_nb_config.c @@ -71,7 +71,7 @@ int bgp_router_create(struct nb_cb_create_args *args) { const struct lyd_node *vrf_dnode; struct bgp *bgp; - const char *vrf_name; + struct vrf *vrf; const char *name = NULL; as_t as; enum bgp_instance_type inst_type; @@ -89,12 +89,12 @@ int bgp_router_create(struct nb_cb_create_args *args) case NB_EV_APPLY: vrf_dnode = yang_dnode_get_parent(args->dnode, "control-plane-protocol"); - vrf_name = yang_dnode_get_string(vrf_dnode, "./vrf"); + vrf = nb_running_get_entry(vrf_dnode, NULL, true); - if (strmatch(vrf_name, VRF_DEFAULT_NAME)) { + if (strmatch(vrf->name, VRF_DEFAULT_NAME)) { name = NULL; } else { - name = vrf_name; + name = vrf->name; inst_type = BGP_INSTANCE_TYPE_VRF; } -- 2.39.5