summaryrefslogtreecommitdiffstats
path: root/bgpd/bgp_damp.c
diff options
context:
space:
mode:
authorIgor Ryzhov <iryzhov@nfware.com>2021-07-29 17:28:06 +0200
committerGitHub <noreply@github.com>2021-07-29 17:28:06 +0200
commit7543016dbc01093d5fbc7e94bbc9bc24344b3efc (patch)
treed966c9ef6cdb0271d79f51451ed1a741995d7af2 /bgpd/bgp_damp.c
parentMerge pull request #9212 from idryzhov/pim-crash (diff)
parentbgpd: Drop double-pointer for bgp_damp_info_free() (diff)
downloadfrr-7543016dbc01093d5fbc7e94bbc9bc24344b3efc.tar.xz
frr-7543016dbc01093d5fbc7e94bbc9bc24344b3efc.zip
Merge pull request #9222 from ton31337/fix/bgp_dampening_clear
bgpd: Drop double-pointer for bgp_damp_info_free()
Diffstat (limited to 'bgpd/bgp_damp.c')
-rw-r--r--bgpd/bgp_damp.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/bgpd/bgp_damp.c b/bgpd/bgp_damp.c
index 21e42ae82..20dfef759 100644
--- a/bgpd/bgp_damp.c
+++ b/bgpd/bgp_damp.c
@@ -278,7 +278,7 @@ static int bgp_reuse_timer(struct thread *t)
}
if (bdi->penalty <= bdc->reuse_limit / 2.0) {
- bgp_damp_info_free(&bdi, bdc, 1, bdi->afi,
+ bgp_damp_info_free(bdi, bdc, 1, bdi->afi,
bdi->safi);
bgp_reuselist_del(&plist, &node);
} else {
@@ -424,27 +424,27 @@ int bgp_damp_update(struct bgp_path_info *path, struct bgp_dest *dest,
bdi->t_updated = t_now;
else {
bgp_damp_info_unclaim(bdi);
- bgp_damp_info_free(&bdi, bdc, 0, afi, safi);
+ bgp_damp_info_free(bdi, bdc, 0, afi, safi);
}
return status;
}
-void bgp_damp_info_free(struct bgp_damp_info **bdi, struct bgp_damp_config *bdc,
+void bgp_damp_info_free(struct bgp_damp_info *bdi, struct bgp_damp_config *bdc,
int withdraw, afi_t afi, safi_t safi)
{
- assert(bdc && bdi && *bdi);
+ assert(bdc && bdi);
- if ((*bdi)->path == NULL) {
- XFREE(MTYPE_BGP_DAMP_INFO, (*bdi));
+ if (bdi->path == NULL) {
+ XFREE(MTYPE_BGP_DAMP_INFO, bdi);
return;
}
- (*bdi)->path->extra->damp_info = NULL;
- bgp_path_info_unset_flag((*bdi)->dest, (*bdi)->path,
+ bdi->path->extra->damp_info = NULL;
+ bgp_path_info_unset_flag(bdi->dest, bdi->path,
BGP_PATH_HISTORY | BGP_PATH_DAMPED);
- if ((*bdi)->lastrecord == BGP_RECORD_WITHDRAW && withdraw)
- bgp_path_info_delete((*bdi)->dest, (*bdi)->path);
+ if (bdi->lastrecord == BGP_RECORD_WITHDRAW && withdraw)
+ bgp_path_info_delete(bdi->dest, bdi->path);
}
static void bgp_damp_parameter_set(int hlife, int reuse, int sup, int maxsup,
@@ -558,14 +558,14 @@ void bgp_damp_info_clean(struct bgp *bgp, struct bgp_damp_config *bdc,
bdi->safi);
}
bgp_reuselist_del(list, &rn);
- bgp_damp_info_free(&bdi, bdc, 1, afi, safi);
+ bgp_damp_info_free(bdi, bdc, 1, afi, safi);
}
}
while ((rn = SLIST_FIRST(&bdc->no_reuse_list)) != NULL) {
bdi = rn->info;
bgp_reuselist_del(&bdc->no_reuse_list, &rn);
- bgp_damp_info_free(&bdi, bdc, 1, afi, safi);
+ bgp_damp_info_free(bdi, bdc, 1, afi, safi);
}
/* Free decay array */