From: Daniel Walton Date: Wed, 4 Nov 2015 16:05:56 +0000 (+0000) Subject: BGP: enable deterministic-med by default X-Git-Tag: frr-2.0-rc1~1209 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=1475ac872b5d0740a4aac699763de9fe57f6cc77;p=matthieu%2Ffrr.git BGP: enable deterministic-med by default Signed-off-by: Daniel Walton Reviewed-by: Donald Sharp Ticket: CM-8006 --- diff --git a/bgpd/bgp_vty.c b/bgpd/bgp_vty.c index 3b4ae3db70..f7d5af1126 100644 --- a/bgpd/bgp_vty.c +++ b/bgpd/bgp_vty.c @@ -1637,8 +1637,12 @@ DEFUN (bgp_deterministic_med, struct bgp *bgp; bgp = vty->index; - bgp_flag_set (bgp, BGP_FLAG_DETERMINISTIC_MED); - bgp_recalculate_all_bestpaths (bgp); + + if (!bgp_flag_check(bgp, BGP_FLAG_DETERMINISTIC_MED)) + { + bgp_flag_set (bgp, BGP_FLAG_DETERMINISTIC_MED); + bgp_recalculate_all_bestpaths (bgp); + } return CMD_SUCCESS; } @@ -1653,8 +1657,12 @@ DEFUN (no_bgp_deterministic_med, struct bgp *bgp; bgp = vty->index; - bgp_flag_unset (bgp, BGP_FLAG_DETERMINISTIC_MED); - bgp_recalculate_all_bestpaths (bgp); + + if (bgp_flag_check(bgp, BGP_FLAG_DETERMINISTIC_MED)) + { + bgp_flag_unset (bgp, BGP_FLAG_DETERMINISTIC_MED); + bgp_recalculate_all_bestpaths (bgp); + } return CMD_SUCCESS; } diff --git a/bgpd/bgpd.c b/bgpd/bgpd.c index 5a950ee91e..ec5ce9bb99 100644 --- a/bgpd/bgpd.c +++ b/bgpd/bgpd.c @@ -2816,6 +2816,7 @@ bgp_create (as_t *as, const char *name) bgp_flag_set (bgp, BGP_FLAG_IMPORT_CHECK); bgp_flag_set (bgp, BGP_FLAG_SHOW_HOSTNAME); bgp_flag_set (bgp, BGP_FLAG_LOG_NEIGHBOR_CHANGES); + bgp_flag_set (bgp, BGP_FLAG_DETERMINISTIC_MED); bgp->as = *as; @@ -6931,8 +6932,8 @@ bgp_config_write (struct vty *vty) vty_out (vty, " bgp enforce-first-as%s", VTY_NEWLINE); /* BGP deterministic-med. */ - if (bgp_flag_check (bgp, BGP_FLAG_DETERMINISTIC_MED)) - vty_out (vty, " bgp deterministic-med%s", VTY_NEWLINE); + if (!bgp_flag_check (bgp, BGP_FLAG_DETERMINISTIC_MED)) + vty_out (vty, " no bgp deterministic-med%s", VTY_NEWLINE); /* BGP update-delay. */ bgp_config_write_update_delay (vty, bgp);