]> git.proxmox.com Git - mirror_frr.git/commitdiff
bgpd: Remove BGP_OPT_MULTIPLE_INSTANCE flag
authorDonald Sharp <sharpd@cumulusnetworks.com>
Mon, 3 Jun 2019 16:55:48 +0000 (12:55 -0400)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Mon, 3 Jun 2019 18:53:55 +0000 (14:53 -0400)
Since we no-longer allow you to select multiple-instance
or not from the cli, let's completely remove the flag
as well.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
bgpd/bgp_vty.c
bgpd/bgpd.c
bgpd/bgpd.h

index 0b621fcf79386e5aa744b92ddb61a182552219de..05898325c5da9a8a68aa2d03bdf1833d464a44af 100644 (file)
@@ -7446,11 +7446,6 @@ DEFUN (show_bgp_views,
        struct listnode *node;
        struct bgp *bgp;
 
-       if (!bgp_option_check(BGP_OPT_MULTIPLE_INSTANCE)) {
-               vty_out(vty, "BGP Multiple Instance is not enabled\n");
-               return CMD_WARNING;
-       }
-
        vty_out(vty, "Defined BGP views:\n");
        for (ALL_LIST_ELEMENTS_RO(inst, node, bgp)) {
                /* Skip VRFs. */
@@ -7481,11 +7476,6 @@ DEFUN (show_bgp_vrfs,
        json_object *json_vrfs = NULL;
        int count = 0;
 
-       if (!bgp_option_check(BGP_OPT_MULTIPLE_INSTANCE)) {
-               vty_out(vty, "BGP Multiple Instance is not enabled\n");
-               return CMD_WARNING;
-       }
-
        if (uj) {
                json = json_object_new_object();
                json_vrfs = json_object_new_object();
index 2e648af1bb986b639f1457f7dd66da5fe89f0458..78d2f9c3edf0b8333e56951bc71870541b048624 100644 (file)
@@ -171,7 +171,6 @@ int bgp_option_set(int flag)
 {
        switch (flag) {
        case BGP_OPT_NO_FIB:
-       case BGP_OPT_MULTIPLE_INSTANCE:
        case BGP_OPT_CONFIG_CISCO:
        case BGP_OPT_NO_LISTEN:
        case BGP_OPT_NO_ZEBRA:
@@ -186,9 +185,6 @@ int bgp_option_set(int flag)
 int bgp_option_unset(int flag)
 {
        switch (flag) {
-       case BGP_OPT_MULTIPLE_INSTANCE:
-               if (listcount(bm->bgp) > 1)
-                       return BGP_ERR_MULTIPLE_INSTANCE_USED;
        /* Fall through.  */
        case BGP_OPT_NO_ZEBRA:
        case BGP_OPT_NO_FIB:
@@ -3174,40 +3170,21 @@ int bgp_get(struct bgp **bgp_val, as_t *as, const char *name,
        struct vrf *vrf = NULL;
 
        /* Multiple instance check. */
-       if (bgp_option_check(BGP_OPT_MULTIPLE_INSTANCE)) {
-               if (name)
-                       bgp = bgp_lookup_by_name(name);
-               else
-                       bgp = bgp_get_default();
-
-               /* Already exists. */
-               if (bgp) {
-                       if (bgp->as != *as) {
-                               *as = bgp->as;
-                               return BGP_ERR_INSTANCE_MISMATCH;
-                       }
-                       if (bgp->inst_type != inst_type)
-                               return BGP_ERR_INSTANCE_MISMATCH;
-                       *bgp_val = bgp;
-                       return 0;
-               }
-       } else {
-               /* BGP instance name can not be specified for single instance.
-                */
-               if (name)
-                       return BGP_ERR_MULTIPLE_INSTANCE_NOT_SET;
-
-               /* Get default BGP structure if exists. */
+       if (name)
+               bgp = bgp_lookup_by_name(name);
+       else
                bgp = bgp_get_default();
 
-               if (bgp) {
-                       if (bgp->as != *as) {
-                               *as = bgp->as;
-                               return BGP_ERR_AS_MISMATCH;
-                       }
-                       *bgp_val = bgp;
-                       return 0;
+       /* Already exists. */
+       if (bgp) {
+               if (bgp->as != *as) {
+                       *as = bgp->as;
+                       return BGP_ERR_INSTANCE_MISMATCH;
                }
+               if (bgp->inst_type != inst_type)
+                       return BGP_ERR_INSTANCE_MISMATCH;
+               *bgp_val = bgp;
+               return 0;
        }
 
        bgp = bgp_create(as, name, inst_type);
@@ -7568,12 +7545,6 @@ int bgp_config_write(struct vty *vty)
        struct listnode *node, *nnode;
        struct listnode *mnode, *mnnode;
 
-       /* BGP Multiple instance. */
-       if (!bgp_option_check(BGP_OPT_MULTIPLE_INSTANCE)) {
-               vty_out(vty, "no bgp multiple-instance\n");
-               write++;
-       }
-
        /* BGP Config type. */
        if (bgp_option_check(BGP_OPT_CONFIG_CISCO)) {
                vty_out(vty, "bgp config-type cisco\n");
@@ -7597,15 +7568,10 @@ int bgp_config_write(struct vty *vty)
                /* Router bgp ASN */
                vty_out(vty, "router bgp %u", bgp->as);
 
-               if (bgp_option_check(BGP_OPT_MULTIPLE_INSTANCE)) {
-                       if (bgp->name)
-                               vty_out(vty, " %s %s",
-                                       (bgp->inst_type
-                                        == BGP_INSTANCE_TYPE_VIEW)
-                                               ? "view"
-                                               : "vrf",
-                                       bgp->name);
-               }
+               if (bgp->name)
+                       vty_out(vty, " %s %s",
+                               (bgp->inst_type  == BGP_INSTANCE_TYPE_VIEW)
+                               ? "view" : "vrf", bgp->name);
                vty_out(vty, "\n");
 
                /* No Synchronization */
@@ -7904,9 +7870,6 @@ void bgp_master_init(struct thread_master *master)
        bf_init(bm->rd_idspace, UINT16_MAX);
        bf_assign_zero_index(bm->rd_idspace);
 
-       /* Enable multiple instances by default. */
-       bgp_option_set(BGP_OPT_MULTIPLE_INSTANCE);
-
        /* mpls label dynamic allocation pool */
        bgp_lp_init(bm->master, &bm->labelpool);
 
index c600d9f3f36d740ecda0e7f4d145b5e5e450e303..7afcf11249e7b036da2fcdfd38a3d4dd9d4ab14b 100644 (file)
@@ -134,7 +134,6 @@ struct bgp_master {
        /* Various BGP global configuration.  */
        uint8_t options;
 #define BGP_OPT_NO_FIB                   (1 << 0)
-#define BGP_OPT_MULTIPLE_INSTANCE        (1 << 1)
 #define BGP_OPT_CONFIG_CISCO             (1 << 2)
 #define BGP_OPT_NO_LISTEN                (1 << 3)
 #define BGP_OPT_NO_ZEBRA                 (1 << 4)