From abe702de9f11b06092dfedb8f2199d05b49dcec4 Mon Sep 17 00:00:00 2001 From: Donatas Abraitis Date: Wed, 10 Jun 2020 10:10:18 +0300 Subject: [PATCH 1/2] bgpd: Allow setting dampening for more address families Until now, it was possible to set only for ipv4 unicast/multicast. Signed-off-by: Donatas Abraitis --- bgpd/bgp_route.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/bgpd/bgp_route.c b/bgpd/bgp_route.c index e8151d94ed..baf6a78021 100644 --- a/bgpd/bgp_route.c +++ b/bgpd/bgp_route.c @@ -13513,14 +13513,21 @@ void bgp_route_init(void) install_element(BGP_IPV6M_NODE, &no_ipv6_bgp_distance_source_access_list_cmd); + /* BGP dampening */ install_element(BGP_NODE, &bgp_damp_set_cmd); install_element(BGP_NODE, &bgp_damp_unset_cmd); install_element(BGP_IPV4_NODE, &bgp_damp_set_cmd); install_element(BGP_IPV4_NODE, &bgp_damp_unset_cmd); - - /* IPv4 Multicast Mode */ install_element(BGP_IPV4M_NODE, &bgp_damp_set_cmd); install_element(BGP_IPV4M_NODE, &bgp_damp_unset_cmd); + install_element(BGP_IPV4L_NODE, &bgp_damp_set_cmd); + install_element(BGP_IPV4L_NODE, &bgp_damp_unset_cmd); + install_element(BGP_IPV6_NODE, &bgp_damp_set_cmd); + install_element(BGP_IPV6_NODE, &bgp_damp_unset_cmd); + install_element(BGP_IPV6M_NODE, &bgp_damp_set_cmd); + install_element(BGP_IPV6M_NODE, &bgp_damp_unset_cmd); + install_element(BGP_IPV6L_NODE, &bgp_damp_set_cmd); + install_element(BGP_IPV6L_NODE, &bgp_damp_unset_cmd); /* Large Communities */ install_element(VIEW_NODE, &show_ip_bgp_large_community_list_cmd); From 923e64a83b24e6ef036cce0a2c4ae72d297f9e90 Mon Sep 17 00:00:00 2001 From: Donatas Abraitis Date: Wed, 10 Jun 2020 10:09:01 +0300 Subject: [PATCH 2/2] bgpd: Print dampening configuration per AF, not per neighbor This caused duplicate `bgp dampening ...` to be printed per neighbor. Signed-off-by: Donatas Abraitis --- bgpd/bgp_vty.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/bgpd/bgp_vty.c b/bgpd/bgp_vty.c index 9890a3f071..3669205ee3 100644 --- a/bgpd/bgp_vty.c +++ b/bgpd/bgp_vty.c @@ -14815,11 +14815,6 @@ static void bgp_config_write_peer_af(struct vty *vty, struct bgp *bgp, vty_out(vty, "\n"); } - /* BGP flag dampening. */ - if (CHECK_FLAG(bgp->af_flags[afi][safi], - BGP_CONFIG_DAMPENING)) - bgp_config_write_damp(vty, afi, safi); - /* Route reflector client. */ if (peergroup_af_flag_check(peer, afi, safi, PEER_FLAG_REFLECTOR_CLIENT)) { @@ -15044,6 +15039,10 @@ static void bgp_config_write_family(struct vty *vty, struct bgp *bgp, afi_t afi, bgp_config_write_redistribute(vty, bgp, afi, safi); + /* BGP flag dampening. */ + if (CHECK_FLAG(bgp->af_flags[afi][safi], BGP_CONFIG_DAMPENING)) + bgp_config_write_damp(vty, afi, safi); + for (ALL_LIST_ELEMENTS(bgp->group, node, nnode, group)) bgp_config_write_peer_af(vty, bgp, group->conf, afi, safi);