forked from Mirror/frr
bgpd: clear ip bgp dampening was not triggering the route calculation for the prefix
Description: clear ip bgp dampening was not triggering the route calculation for the prefix, Due to this prefix are not install in RIB(Zebra) and not adv to neighbor Problem Description/Summary : clear ip bgp dampening was not triggering the route calculation for the prefix, Due to this prefix are not install in RIB(Zebra) and not adv to neighbor Fix: When clear ip bgp dampening, route are put for route-calculation as that it is install in the Zebra and adv to neighbor. Signed-off-by: sudhanshukumar22 <sudhanshu.kumar@broadcom.com>
This commit is contained in:
parent
b29ef1082d
commit
debe0f528c
|
@ -533,7 +533,8 @@ int bgp_damp_enable(struct bgp *bgp, afi_t afi, safi_t safi, time_t half,
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Clean all the bgp_damp_info stored in reuse_list and no_reuse_list. */
|
/* Clean all the bgp_damp_info stored in reuse_list and no_reuse_list. */
|
||||||
void bgp_damp_info_clean(struct bgp_damp_config *bdc, afi_t afi, safi_t safi)
|
void bgp_damp_info_clean(struct bgp *bgp, struct bgp_damp_config *bdc,
|
||||||
|
afi_t afi, safi_t safi)
|
||||||
{
|
{
|
||||||
struct bgp_damp_info *bdi;
|
struct bgp_damp_info *bdi;
|
||||||
struct reuselist_node *rn;
|
struct reuselist_node *rn;
|
||||||
|
@ -545,6 +546,13 @@ void bgp_damp_info_clean(struct bgp_damp_config *bdc, afi_t afi, safi_t safi)
|
||||||
list = &bdc->reuse_list[i];
|
list = &bdc->reuse_list[i];
|
||||||
while ((rn = SLIST_FIRST(list)) != NULL) {
|
while ((rn = SLIST_FIRST(list)) != NULL) {
|
||||||
bdi = rn->info;
|
bdi = rn->info;
|
||||||
|
if (bdi->lastrecord == BGP_RECORD_UPDATE) {
|
||||||
|
bgp_aggregate_increment(bgp, &bdi->dest->p,
|
||||||
|
bdi->path, bdi->afi,
|
||||||
|
bdi->safi);
|
||||||
|
bgp_process(bgp, bdi->dest, bdi->afi,
|
||||||
|
bdi->safi);
|
||||||
|
}
|
||||||
bgp_reuselist_del(list, &rn);
|
bgp_reuselist_del(list, &rn);
|
||||||
bgp_damp_info_free(&bdi, bdc, 1, afi, safi);
|
bgp_damp_info_free(&bdi, bdc, 1, afi, safi);
|
||||||
}
|
}
|
||||||
|
@ -595,7 +603,7 @@ int bgp_damp_disable(struct bgp *bgp, afi_t afi, safi_t safi)
|
||||||
EVENT_OFF(bdc->t_reuse);
|
EVENT_OFF(bdc->t_reuse);
|
||||||
|
|
||||||
/* Clean BGP dampening information. */
|
/* Clean BGP dampening information. */
|
||||||
bgp_damp_info_clean(bdc, afi, safi);
|
bgp_damp_info_clean(bgp, bdc, afi, safi);
|
||||||
|
|
||||||
UNSET_FLAG(bgp->af_flags[afi][safi], BGP_CONFIG_DAMPENING);
|
UNSET_FLAG(bgp->af_flags[afi][safi], BGP_CONFIG_DAMPENING);
|
||||||
|
|
||||||
|
@ -910,7 +918,7 @@ void bgp_peer_damp_disable(struct peer *peer, afi_t afi, safi_t safi)
|
||||||
bdc = &peer->damp[afi][safi];
|
bdc = &peer->damp[afi][safi];
|
||||||
if (!bdc)
|
if (!bdc)
|
||||||
return;
|
return;
|
||||||
bgp_damp_info_clean(bdc, afi, safi);
|
bgp_damp_info_clean(peer->bgp, bdc, afi, safi);
|
||||||
UNSET_FLAG(peer->af_flags[afi][safi], PEER_FLAG_CONFIG_DAMPENING);
|
UNSET_FLAG(peer->af_flags[afi][safi], PEER_FLAG_CONFIG_DAMPENING);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -136,8 +136,8 @@ extern int bgp_damp_update(struct bgp_path_info *path, struct bgp_dest *dest,
|
||||||
extern void bgp_damp_info_free(struct bgp_damp_info **path,
|
extern void bgp_damp_info_free(struct bgp_damp_info **path,
|
||||||
struct bgp_damp_config *bdc, int withdraw,
|
struct bgp_damp_config *bdc, int withdraw,
|
||||||
afi_t afi, safi_t safi);
|
afi_t afi, safi_t safi);
|
||||||
extern void bgp_damp_info_clean(struct bgp_damp_config *bdc, afi_t afi,
|
extern void bgp_damp_info_clean(struct bgp *bgp, struct bgp_damp_config *bdc,
|
||||||
safi_t safi);
|
afi_t afi, safi_t safi);
|
||||||
extern void bgp_damp_config_clean(struct bgp_damp_config *bdc);
|
extern void bgp_damp_config_clean(struct bgp_damp_config *bdc);
|
||||||
extern int bgp_damp_decay(time_t tdiff, int penalty,
|
extern int bgp_damp_decay(time_t tdiff, int penalty,
|
||||||
struct bgp_damp_config *bdc);
|
struct bgp_damp_config *bdc);
|
||||||
|
|
|
@ -15848,6 +15848,21 @@ static int bgp_clear_damp_route(struct vty *vty, const char *view_name,
|
||||||
while (pi) {
|
while (pi) {
|
||||||
if (pi->extra && pi->extra->damp_info) {
|
if (pi->extra && pi->extra->damp_info) {
|
||||||
pi_temp = pi->next;
|
pi_temp = pi->next;
|
||||||
|
struct bgp_damp_info *bdi =
|
||||||
|
pi->extra->damp_info;
|
||||||
|
if (bdi->lastrecord
|
||||||
|
== BGP_RECORD_UPDATE) {
|
||||||
|
bgp_aggregate_increment(
|
||||||
|
bgp,
|
||||||
|
&bdi->dest->p,
|
||||||
|
bdi->path,
|
||||||
|
bdi->afi,
|
||||||
|
bdi->safi);
|
||||||
|
bgp_process(bgp,
|
||||||
|
bdi->dest,
|
||||||
|
bdi->afi,
|
||||||
|
bdi->safi);
|
||||||
|
}
|
||||||
bgp_damp_info_free(
|
bgp_damp_info_free(
|
||||||
&pi->extra->damp_info,
|
&pi->extra->damp_info,
|
||||||
&bgp->damp[afi][safi],
|
&bgp->damp[afi][safi],
|
||||||
|
@ -15874,7 +15889,7 @@ DEFUN (clear_ip_bgp_dampening,
|
||||||
"Clear route flap dampening information\n")
|
"Clear route flap dampening information\n")
|
||||||
{
|
{
|
||||||
VTY_DECLVAR_CONTEXT(bgp, bgp);
|
VTY_DECLVAR_CONTEXT(bgp, bgp);
|
||||||
bgp_damp_info_clean(&bgp->damp[AFI_IP][SAFI_UNICAST], AFI_IP,
|
bgp_damp_info_clean(bgp, &bgp->damp[AFI_IP][SAFI_UNICAST], AFI_IP,
|
||||||
SAFI_UNICAST);
|
SAFI_UNICAST);
|
||||||
return CMD_SUCCESS;
|
return CMD_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue