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;
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 */
/* "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;
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);
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;
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",