]> git.puffer.fish Git - mirror/frr.git/commitdiff
Revert "bgpd: no router bgp check candidate config"
authorIgor Ryzhov <iryzhov@nfware.com>
Thu, 13 May 2021 23:13:15 +0000 (02:13 +0300)
committerIgor Ryzhov <iryzhov@nfware.com>
Tue, 3 Aug 2021 20:36:31 +0000 (23:36 +0300)
This reverts commit 4b63e358bc213bfa9d1baeda6fbbdfa39df60d2e.

bgpd/bgp_vty.c

index 1cdda1b13409feaed26a7fadd56d721fa32c2083..e31c04434c9eed5a815e4cdf9f8e852b9d21676f 100644 (file)
@@ -1406,17 +1406,13 @@ DEFUN_YANG(no_router_bgp,
        struct bgp *bgp;
        const char *name = NULL;
        char base_xpath[XPATH_MAXLEN];
-       const struct lyd_node *bgp_glb_dnode;
 
        // "no router bgp" without an ASN
        if (argc == 3) {
                // Pending: Make VRF option available for ASN less config
-               snprintf(base_xpath, sizeof(base_xpath), FRR_BGP_GLOBAL_XPATH,
-                        "frr-bgp:bgp", "bgp", VRF_DEFAULT_NAME);
+               bgp = bgp_get_default();
 
-               bgp_glb_dnode = yang_dnode_get(vty->candidate_config->dnode,
-                                              base_xpath);
-               if (!bgp_glb_dnode) {
+               if (bgp == NULL) {
                        vty_out(vty, "%% No BGP process is configured\n");
                        return CMD_WARNING_CONFIG_FAILED;
                }
@@ -1426,11 +1422,6 @@ DEFUN_YANG(no_router_bgp,
                        return CMD_WARNING_CONFIG_FAILED;
                }
 
-               /* tcli mode bgp would not be set until apply stage. */
-               bgp = nb_running_get_entry(bgp_glb_dnode, NULL, false);
-               if (!bgp)
-                       return CMD_SUCCESS;
-
                if (bgp->l3vni) {
                        vty_out(vty, "%% Please unconfigure l3vni %u",
                                bgp->l3vni);