diff options
author | Donald Sharp <sharpd@cumulusnetworks.com> | 2020-03-27 00:11:58 +0100 |
---|---|---|
committer | David Lamparter <equinox@diac24.net> | 2020-06-23 17:32:52 +0200 |
commit | 9bcb3eef541180a17341d1d4510586efc35711db (patch) | |
tree | 686e6d7721a180a168cb3353e2c900b63069e6c3 /bgpd/bgp_damp.c | |
parent | Merge pull request #6625 from ton31337/fix/network_check_import_for_static_bgp (diff) | |
download | frr-9bcb3eef541180a17341d1d4510586efc35711db.tar.xz frr-9bcb3eef541180a17341d1d4510586efc35711db.zip |
bgp: rename bgp_node to bgp_dest
This is the bulk part extracted from "bgpd: Convert from `struct
bgp_node` to `struct bgp_dest`". It should not result in any functional
change.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
Diffstat (limited to 'bgpd/bgp_damp.c')
-rw-r--r-- | bgpd/bgp_damp.c | 31 |
1 files changed, 16 insertions, 15 deletions
diff --git a/bgpd/bgp_damp.c b/bgpd/bgp_damp.c index 538610f6d..97d625493 100644 --- a/bgpd/bgp_damp.c +++ b/bgpd/bgp_damp.c @@ -148,17 +148,18 @@ static int bgp_reuse_timer(struct thread *t) /* if (figure-of-merit < reuse). */ if (bdi->penalty < bdc->reuse_limit) { /* Reuse the route. */ - bgp_path_info_unset_flag(bdi->rn, bdi->path, + bgp_path_info_unset_flag(bdi->dest, bdi->path, BGP_PATH_DAMPED); bdi->suppress_time = 0; if (bdi->lastrecord == BGP_RECORD_UPDATE) { - bgp_path_info_unset_flag(bdi->rn, bdi->path, + bgp_path_info_unset_flag(bdi->dest, bdi->path, BGP_PATH_HISTORY); bgp_aggregate_increment( - bgp, bgp_node_get_prefix(bdi->rn), + bgp, bgp_dest_get_prefix(bdi->dest), bdi->path, bdi->afi, bdi->safi); - bgp_process(bgp, bdi->rn, bdi->afi, bdi->safi); + bgp_process(bgp, bdi->dest, bdi->afi, + bdi->safi); } if (bdi->penalty <= bdc->reuse_limit / 2.0) @@ -175,7 +176,7 @@ static int bgp_reuse_timer(struct thread *t) } /* A route becomes unreachable (RFC2439 Section 4.8.2). */ -int bgp_damp_withdraw(struct bgp_path_info *path, struct bgp_node *rn, +int bgp_damp_withdraw(struct bgp_path_info *path, struct bgp_dest *dest, afi_t afi, safi_t safi, int attr_change) { time_t t_now; @@ -200,7 +201,7 @@ int bgp_damp_withdraw(struct bgp_path_info *path, struct bgp_node *rn, bdi = XCALLOC(MTYPE_BGP_DAMP_INFO, sizeof(struct bgp_damp_info)); bdi->path = path; - bdi->rn = rn; + bdi->dest = dest; bdi->penalty = (attr_change ? DEFAULT_PENALTY / 2 : DEFAULT_PENALTY); bdi->flap = 1; @@ -226,13 +227,13 @@ int bgp_damp_withdraw(struct bgp_path_info *path, struct bgp_node *rn, bdi->flap++; } - assert((rn == bdi->rn) && (path == bdi->path)); + assert((dest == bdi->dest) && (path == bdi->path)); bdi->lastrecord = BGP_RECORD_WITHDRAW; bdi->t_updated = t_now; /* Make this route as historical status. */ - bgp_path_info_set_flag(rn, path, BGP_PATH_HISTORY); + bgp_path_info_set_flag(dest, path, BGP_PATH_HISTORY); /* Remove the route from a reuse list if it is on one. */ if (CHECK_FLAG(bdi->path->flags, BGP_PATH_DAMPED)) { @@ -247,7 +248,7 @@ int bgp_damp_withdraw(struct bgp_path_info *path, struct bgp_node *rn, /* If not suppressed before, do annonunce this withdraw and insert into reuse_list. */ if (bdi->penalty >= bdc->suppress_value) { - bgp_path_info_set_flag(rn, path, BGP_PATH_DAMPED); + bgp_path_info_set_flag(dest, path, BGP_PATH_DAMPED); bdi->suppress_time = t_now; BGP_DAMP_LIST_DEL(bdc, bdi); bgp_reuse_list_add(bdi, bdc); @@ -256,8 +257,8 @@ int bgp_damp_withdraw(struct bgp_path_info *path, struct bgp_node *rn, return BGP_DAMP_USED; } -int bgp_damp_update(struct bgp_path_info *path, struct bgp_node *rn, afi_t afi, - safi_t safi) +int bgp_damp_update(struct bgp_path_info *path, struct bgp_dest *dest, + afi_t afi, safi_t safi) { time_t t_now; struct bgp_damp_info *bdi; @@ -268,7 +269,7 @@ int bgp_damp_update(struct bgp_path_info *path, struct bgp_node *rn, afi_t afi, return BGP_DAMP_USED; t_now = bgp_clock(); - bgp_path_info_unset_flag(rn, path, BGP_PATH_HISTORY); + bgp_path_info_unset_flag(dest, path, BGP_PATH_HISTORY); bdi->lastrecord = BGP_RECORD_UPDATE; bdi->penalty = @@ -279,7 +280,7 @@ int bgp_damp_update(struct bgp_path_info *path, struct bgp_node *rn, afi_t afi, status = BGP_DAMP_USED; else if (CHECK_FLAG(bdi->path->flags, BGP_PATH_DAMPED) && (bdi->penalty < bdc->reuse_limit)) { - bgp_path_info_unset_flag(rn, path, BGP_PATH_DAMPED); + bgp_path_info_unset_flag(dest, path, BGP_PATH_DAMPED); bgp_reuse_list_delete(bdi, bdc); BGP_DAMP_LIST_ADD(bdc, bdi); bdi->suppress_time = 0; @@ -312,11 +313,11 @@ void bgp_damp_info_free(struct bgp_damp_info *bdi, int withdraw, afi_t afi, else BGP_DAMP_LIST_DEL(bdc, bdi); - bgp_path_info_unset_flag(bdi->rn, path, + bgp_path_info_unset_flag(bdi->dest, path, BGP_PATH_HISTORY | BGP_PATH_DAMPED); if (bdi->lastrecord == BGP_RECORD_WITHDRAW && withdraw) - bgp_path_info_delete(bdi->rn, path); + bgp_path_info_delete(bdi->dest, path); XFREE(MTYPE_BGP_DAMP_INFO, bdi); } |