diff options
| author | Donald Sharp <sharpd@nvidia.com> | 2021-01-05 11:10:19 -0500 |
|---|---|---|
| committer | Donald Sharp <sharpd@nvidia.com> | 2021-01-05 15:37:32 -0500 |
| commit | 6f4196d72b2aba8497ff91940db60c57647314ec (patch) | |
| tree | a0d49d9d3dd5e114e413650c525821ead924996b /pathd/path_pcep_controller.c | |
| parent | 6b669132759d9ce501e2ab2621f4347f70226e40 (diff) | |
pathd: Convert to use our internal frr_weak_random
rand() should not be used, we should be using the frr_weak_random()
call instead.
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
Diffstat (limited to 'pathd/path_pcep_controller.c')
| -rw-r--r-- | pathd/path_pcep_controller.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/pathd/path_pcep_controller.c b/pathd/path_pcep_controller.c index e467a79a87..255503b459 100644 --- a/pathd/path_pcep_controller.c +++ b/pathd/path_pcep_controller.c @@ -26,6 +26,7 @@ #include "northbound.h" #include "frr_pthread.h" #include "jhash.h" +#include "network.h" #include "pathd/pathd.h" #include "pathd/path_errors.h" @@ -1043,7 +1044,7 @@ void remove_pcc_state(struct ctrl_state *ctrl_state, uint32_t backoff_delay(uint32_t max, uint32_t base, uint32_t retry_count) { uint32_t a = min(max, base * (1 << retry_count)); - uint64_t r = rand(), m = RAND_MAX; + uint64_t r = frr_weak_random(), m = RAND_MAX; uint32_t b = (a / 2) + (r * (a / 2)) / m; return b; } |
