]> git.proxmox.com Git - mirror_frr.git/commitdiff
Quagga default: BGP "no-as-set" should be the default for "bgp as-path multipath...
authorDaniel Walton <dwalton@cumulusnetworks.com>
Tue, 10 Nov 2015 15:33:24 +0000 (15:33 +0000)
committerDaniel Walton <dwalton@cumulusnetworks.com>
Tue, 10 Nov 2015 15:33:24 +0000 (15:33 +0000)
Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
Reviewed-by: Donald Sharp <sharpd@cumulusnetworks.com>
Ticket: CM-7928

bgpd/bgp_mpath.c
bgpd/bgp_vty.c
bgpd/bgpd.c
bgpd/bgpd.h

index 14fb49c38b1414e97910771e0fcd22d65a17da37..30eefdb5fed18ba51dfab3b6e2900c5f7ae3f2d6 100644 (file)
@@ -621,7 +621,7 @@ bgp_info_mpath_aggregate_update (struct bgp_info *new_best,
   struct aspath *aspath;
   struct aspath *asmerge;
   struct attr *new_attr, *old_attr;
-  u_char origin, attr_chg;
+  u_char origin;
   struct community *community, *commerge;
   struct ecommunity *ecomm, *ecommerge;
   struct attr_extra *ae;
@@ -648,41 +648,10 @@ bgp_info_mpath_aggregate_update (struct bgp_info *new_best,
       return;
     }
 
-  /*
-   * Bail out here if the following is true:
-   * - MULTIPATH_CHG bit is not set on new_best, and
-   * - No change in bestpath, and
-   * - ATTR_CHANGED bit is not set on new_best or any of the multipaths
-   */
-  if (!CHECK_FLAG (new_best->flags, BGP_INFO_MULTIPATH_CHG) &&
-      (old_best == new_best))
-    {
-      attr_chg = 0;
-
-      if (CHECK_FLAG (new_best->flags, BGP_INFO_ATTR_CHANGED))
-        attr_chg = 1;
-      else
-        for (mpinfo = bgp_info_mpath_first (new_best); mpinfo;
-             mpinfo = bgp_info_mpath_next (mpinfo))
-          {
-            if (CHECK_FLAG (mpinfo->flags, BGP_INFO_ATTR_CHANGED))
-              {
-                attr_chg = 1;
-                break;
-              }
-          }
-
-      if (!attr_chg)
-        {
-          assert (bgp_info_mpath_attr (new_best));
-          return;
-        }
-    }
-
   bgp_attr_dup (&attr, new_best->attr);
 
   if (new_best->peer &&
-      !bgp_flag_check (new_best->peer->bgp, BGP_FLAG_MULTIPATH_RELAX_NO_AS_SET))
+      bgp_flag_check (new_best->peer->bgp, BGP_FLAG_MULTIPATH_RELAX_AS_SET))
     {
 
       /* aggregate attribute from multipath constituents */
index c71baa2a1eb9aff2da08a1fd65c7b5d5c2d30031..6bbb5d8dd3b3212854b4210e24b3c793a0b099ee 100644 (file)
@@ -1919,76 +1919,47 @@ DEFUN (no_bgp_bestpath_aspath_confed,
 /* "bgp bestpath as-path multipath-relax" configuration.  */
 DEFUN (bgp_bestpath_aspath_multipath_relax,
        bgp_bestpath_aspath_multipath_relax_cmd,
-       "bgp bestpath as-path multipath-relax",
-       "BGP specific commands\n"
-       "Change the default bestpath selection\n"
-       "AS-path attribute\n"
-       "Allow load sharing across routes that have different AS paths (but same length)\n")
-{
-  struct bgp *bgp;
-
-  bgp = vty->index;
-  bgp_flag_set (bgp, BGP_FLAG_ASPATH_MULTIPATH_RELAX);
-  bgp_flag_unset (bgp, BGP_FLAG_MULTIPATH_RELAX_NO_AS_SET);
-  bgp_recalculate_all_bestpaths (bgp);
-
-  return CMD_SUCCESS;
-}
-
-DEFUN (no_bgp_bestpath_aspath_multipath_relax,
-       no_bgp_bestpath_aspath_multipath_relax_cmd,
-       "no bgp bestpath as-path multipath-relax",
-       NO_STR
-       "BGP specific commands\n"
-       "Change the default bestpath selection\n"
-       "AS-path attribute\n"
-       "Allow load sharing across routes that have different AS paths (but same length)\n")
-{
-  struct bgp *bgp;
-
-  bgp = vty->index;
-  bgp_flag_unset (bgp, BGP_FLAG_ASPATH_MULTIPATH_RELAX);
-  bgp_flag_unset (bgp, BGP_FLAG_MULTIPATH_RELAX_NO_AS_SET);
-  bgp_recalculate_all_bestpaths (bgp);
-
-  return CMD_SUCCESS;
-}
-
-/* "bgp bestpath as-path multipath-relax no-as-set" configuration.  */
-DEFUN (bgp_bestpath_aspath_multipath_relax_no_as_set,
-       bgp_bestpath_aspath_multipath_relax_no_as_set_cmd,
-       "bgp bestpath as-path multipath-relax no-as-set",
+       "bgp bestpath as-path multipath-relax {as-set|no-as-set}",
        "BGP specific commands\n"
        "Change the default bestpath selection\n"
        "AS-path attribute\n"
        "Allow load sharing across routes that have different AS paths (but same length)\n"
+       "Generate an AS_SET\n"
        "Do not generate an AS_SET\n")
 {
   struct bgp *bgp;
 
   bgp = vty->index;
   bgp_flag_set (bgp, BGP_FLAG_ASPATH_MULTIPATH_RELAX);
-  bgp_flag_set (bgp, BGP_FLAG_MULTIPATH_RELAX_NO_AS_SET);
+
+  /* no-as-set is now the default behavior so we can silently
+   * ignore it */
+  if (argv[0] != NULL && strncmp (argv[0], "a", 1) == 0)
+    bgp_flag_set (bgp, BGP_FLAG_MULTIPATH_RELAX_AS_SET);
+  else
+    bgp_flag_unset (bgp, BGP_FLAG_MULTIPATH_RELAX_AS_SET) ;
+
   bgp_recalculate_all_bestpaths (bgp);
 
   return CMD_SUCCESS;
 }
 
-DEFUN (no_bgp_bestpath_aspath_multipath_relax_no_as_set,
-       no_bgp_bestpath_aspath_multipath_relax_no_as_set_cmd,
-       "no bgp bestpath as-path multipath-relax no-as-set",
+DEFUN (no_bgp_bestpath_aspath_multipath_relax,
+       no_bgp_bestpath_aspath_multipath_relax_cmd,
+       "no bgp bestpath as-path multipath-relax {as-set|no-as-set}",
        NO_STR
        "BGP specific commands\n"
        "Change the default bestpath selection\n"
        "AS-path attribute\n"
        "Allow load sharing across routes that have different AS paths (but same length)\n"
+       "Generate an AS_SET\n"
        "Do not generate an AS_SET\n")
 {
   struct bgp *bgp;
 
   bgp = vty->index;
   bgp_flag_unset (bgp, BGP_FLAG_ASPATH_MULTIPATH_RELAX);
-  bgp_flag_unset (bgp, BGP_FLAG_MULTIPATH_RELAX_NO_AS_SET);
+  bgp_flag_unset (bgp, BGP_FLAG_MULTIPATH_RELAX_AS_SET);
   bgp_recalculate_all_bestpaths (bgp);
 
   return CMD_SUCCESS;
@@ -12165,10 +12136,6 @@ bgp_vty_init (void)
   install_element (BGP_NODE, &bgp_bestpath_aspath_multipath_relax_cmd);
   install_element (BGP_NODE, &no_bgp_bestpath_aspath_multipath_relax_cmd);
 
-  /* "bgp bestpath as-path multipath-relax no-as-set" commands */
-  install_element (BGP_NODE, &bgp_bestpath_aspath_multipath_relax_no_as_set_cmd);
-  install_element (BGP_NODE, &no_bgp_bestpath_aspath_multipath_relax_no_as_set_cmd);
-
   /* "bgp log-neighbor-changes" commands */
   install_element (BGP_NODE, &bgp_log_neighbor_changes_cmd);
   install_element (BGP_NODE, &no_bgp_log_neighbor_changes_cmd);
index 51712cee3bba6799f258e3ebeba19c2dfbbf3ebc..cc160a52fe3a7101a6e256fc5cc7588fdcb8654f 100644 (file)
@@ -2686,8 +2686,10 @@ bgp_create (as_t *as, const char *name)
        bgp->route[afi][safi] = bgp_table_init (afi, safi);
        bgp->aggregate[afi][safi] = bgp_table_init (afi, safi);
        bgp->rib[afi][safi] = bgp_table_init (afi, safi);
-       bgp->maxpaths[afi][safi].maxpaths_ebgp = BGP_DEFAULT_MAXPATHS;
-       bgp->maxpaths[afi][safi].maxpaths_ibgp = BGP_DEFAULT_MAXPATHS;
+
+        /* Enable maximum-paths */
+        bgp_maximum_paths_set (bgp, afi, safi, BGP_PEER_EBGP, BGP_DEFAULT_MAXPATHS, 0);
+        bgp_maximum_paths_set (bgp, afi, safi, BGP_PEER_IBGP, BGP_DEFAULT_MAXPATHS, 0);
       }
 
   bgp->v_update_delay = BGP_UPDATE_DELAY_DEF;
@@ -6889,13 +6891,17 @@ bgp_config_write (struct vty *vty)
       if (bgp_flag_check (bgp, BGP_FLAG_ASPATH_CONFED))
        vty_out (vty, " bgp bestpath as-path confed%s", VTY_NEWLINE);
 
-      if (bgp_flag_check (bgp, BGP_FLAG_ASPATH_MULTIPATH_RELAX)) {
-        if (bgp_flag_check (bgp, BGP_FLAG_MULTIPATH_RELAX_NO_AS_SET)) {
-         vty_out (vty, " bgp bestpath as-path multipath-relax no-as-set%s", VTY_NEWLINE);
-        } else {
-         vty_out (vty, " bgp bestpath as-path multipath-relax%s", VTY_NEWLINE);
+      if (bgp_flag_check (bgp, BGP_FLAG_ASPATH_MULTIPATH_RELAX))
+        {
+          if (bgp_flag_check (bgp, BGP_FLAG_MULTIPATH_RELAX_AS_SET))
+            {
+              vty_out (vty, " bgp bestpath as-path multipath-relax as-set%s", VTY_NEWLINE);
+            }
+        }
+     else
+        {
+         vty_out (vty, " no bgp bestpath as-path multipath-relax%s", VTY_NEWLINE);
         }
-      }
 
       if (bgp_flag_check (bgp, BGP_FLAG_RR_ALLOW_OUTBOUND_POLICY)) {
        vty_out (vty, " bgp route-reflector allow-outbound-policy%s",
index 24b39dd7f5357b9d9f826e4866c98ceb60821c44..76486a4290f6405aa9364fb25c444b1ffb9d80e5 100644 (file)
@@ -249,7 +249,7 @@ struct bgp
 #define BGP_FLAG_ASPATH_MULTIPATH_RELAX   (1 << 14)
 #define BGP_FLAG_RR_ALLOW_OUTBOUND_POLICY (1 << 15)
 #define BGP_FLAG_DISABLE_NH_CONNECTED_CHK (1 << 16)
-#define BGP_FLAG_MULTIPATH_RELAX_NO_AS_SET (1 << 17)
+#define BGP_FLAG_MULTIPATH_RELAX_AS_SET   (1 << 17)
 #define BGP_FLAG_FORCE_STATIC_PROCESS     (1 << 18)
 #define BGP_FLAG_SHOW_HOSTNAME            (1 << 19)