summaryrefslogtreecommitdiffstats
path: root/nhrpd/nhrp_peer.c
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@nvidia.com>2022-08-15 17:31:21 +0200
committerDonald Sharp <sharpd@nvidia.com>2022-08-15 21:45:05 +0200
commit7fc3f834e99030b5ec2a62f120a995d617161d47 (patch)
tree8bd85331dee3ca71eac611ec1ebe69b34d8c5537 /nhrpd/nhrp_peer.c
parentbgpd: Ensure bgp_vrf is non-null (diff)
downloadfrr-7fc3f834e99030b5ec2a62f120a995d617161d47.tar.xz
frr-7fc3f834e99030b5ec2a62f120a995d617161d47.zip
nhrpd: Use frr_weak_random()
Convert usage of rand() to frr_weak_random() Signed-off-by: Donald Sharp <sharpd@nvidia.com>
Diffstat (limited to 'nhrpd/nhrp_peer.c')
-rw-r--r--nhrpd/nhrp_peer.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/nhrpd/nhrp_peer.c b/nhrpd/nhrp_peer.c
index 4b0303256..e7f2eaf5a 100644
--- a/nhrpd/nhrp_peer.c
+++ b/nhrpd/nhrp_peer.c
@@ -17,6 +17,7 @@
#include "memory.h"
#include "thread.h"
#include "hash.h"
+#include "network.h"
#include "nhrpd.h"
#include "nhrp_protocol.h"
@@ -334,7 +335,7 @@ int nhrp_peer_check(struct nhrp_peer *p, int establish)
&p->t_fallback);
} else {
/* Maximum timeout is 1 second */
- int r_time_ms = rand() % 1000;
+ int r_time_ms = frr_weak_random() % 1000;
debugf(NHRP_DEBUG_COMMON,
"Initiating IPsec connection request to %pSU after %d ms:",