summaryrefslogtreecommitdiffstats
path: root/pbrd
diff options
context:
space:
mode:
authorWesley Coakley <wcoakley@nvidia.com>2020-09-01 18:34:48 +0200
committerWesley Coakley <wcoakley@nvidia.com>2020-09-01 18:34:48 +0200
commit4bf97ce1801835f5498852cd825d77c22d3b1e8b (patch)
treec268d2495a736a680fa20472ede14789641083b5 /pbrd
parentpbrd: be more selective about route updates (diff)
downloadfrr-4bf97ce1801835f5498852cd825d77c22d3b1e8b.tar.xz
frr-4bf97ce1801835f5498852cd825d77c22d3b1e8b.zip
pbrd: nh "valid" semantics in nexthop tracking
Signed-off-by: Wesley Coakley <wcoakley@nvidia.com>
Diffstat (limited to 'pbrd')
-rw-r--r--pbrd/pbr_nht.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/pbrd/pbr_nht.c b/pbrd/pbr_nht.c
index d3636c966..3fb375904 100644
--- a/pbrd/pbr_nht.c
+++ b/pbrd/pbr_nht.c
@@ -708,7 +708,7 @@ struct pbr_nht_individual {
struct pbr_nexthop_cache *pnhc;
vrf_id_t old_vrf_id;
- uint32_t valid;
+ bool valid;
bool nhr_matched;
};
@@ -839,7 +839,7 @@ static void pbr_nht_individual_nexthop_update_lookup(struct hash_bucket *b,
pnhc->valid);
if (pnhc->valid)
- pnhi->valid += 1;
+ pnhi->valid = true;
}
static void pbr_nexthop_group_cache_iterate_to_group(struct hash_bucket *b,
@@ -871,7 +871,7 @@ static void pbr_nht_nexthop_update_lookup(struct hash_bucket *b, void *data)
old_valid = pnhgc->valid;
pnhi.nhr = (struct zapi_route *)data;
- pnhi.valid = 0;
+ pnhi.valid = false;
pnhi.nhr_matched = false;
hash_iterate(pnhgc->nhh, pbr_nht_individual_nexthop_update_lookup,
&pnhi);
@@ -1091,7 +1091,7 @@ pbr_nht_individual_nexthop_interface_update_lookup(struct hash_bucket *b,
old_valid, pnhc->valid);
if (pnhc->valid)
- pnhi->valid += 1;
+ pnhi->valid = true;
}
static void pbr_nht_nexthop_interface_update_lookup(struct hash_bucket *b,
@@ -1104,14 +1104,14 @@ static void pbr_nht_nexthop_interface_update_lookup(struct hash_bucket *b,
old_valid = pnhgc->valid;
pnhi.ifp = data;
- pnhi.valid = 0;
+ pnhi.valid = false;
hash_iterate(pnhgc->nhh,
pbr_nht_individual_nexthop_interface_update_lookup, &pnhi);
/*
* If any of the specified nexthops are valid we are valid
*/
- pnhgc->valid = !!pnhi.valid;
+ pnhgc->valid = pnhi.valid;
if (old_valid != pnhgc->valid)
pbr_map_check_nh_group_change(pnhgc->name);