rand() should not be used, we should be using the frr_weak_random()
call instead.
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
#include "northbound.h"
#include "frr_pthread.h"
#include "jhash.h"
+#include "network.h"
#include "pathd/pathd.h"
#include "pathd/path_errors.h"
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;
}
#include "memory.h"
#include "log.h"
#include "lib_errors.h"
+#include "network.h"
#include "pathd/pathd.h"
#include "pathd/path_memory.h"
candidate->preference = preference;
candidate->policy = policy;
candidate->type = SRTE_CANDIDATE_TYPE_UNDEFINED;
- candidate->discriminator = rand();
+ candidate->discriminator = frr_weak_random();
lsp->candidate = candidate;
candidate->lsp = lsp;