summaryrefslogtreecommitdiffstats
path: root/zebra/irdp_interface.c
diff options
context:
space:
mode:
authorRafael Zalamena <rzalamena@opensourcerouting.org>2020-04-17 15:35:15 +0200
committerRafael Zalamena <rzalamena@opensourcerouting.org>2020-04-18 01:57:43 +0200
commit5920b3eb38a6cfd1c9b87106aa7403171408f0bd (patch)
treefe6c96488ab537bebfeb07f658b4d500ba20c446 /zebra/irdp_interface.c
parentMerge pull request #6248 from donaldsharp/zebra_snmp (diff)
downloadfrr-5920b3eb38a6cfd1c9b87106aa7403171408f0bd.tar.xz
frr-5920b3eb38a6cfd1c9b87106aa7403171408f0bd.zip
*: replace all random() calls
Replace all `random()` calls with a function called `frr_weak_random()` and make it clear that it is only supposed to be used for weak random applications. Use the annotation described by the Coverity Scan documentation to ignore `random()` call warnings. Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
Diffstat (limited to 'zebra/irdp_interface.c')
-rw-r--r--zebra/irdp_interface.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/zebra/irdp_interface.c b/zebra/irdp_interface.c
index 8e1ca122d..87a1f5fdc 100644
--- a/zebra/irdp_interface.c
+++ b/zebra/irdp_interface.c
@@ -53,6 +53,7 @@
#include "if.h"
#include "sockunion.h"
#include "log.h"
+#include "network.h"
extern int irdp_sock;
@@ -267,7 +268,7 @@ static void irdp_if_start(struct interface *ifp, int multicast,
}
srandom(seed);
- timer = (random() % IRDP_DEFAULT_INTERVAL) + 1;
+ timer = (frr_weak_random() % IRDP_DEFAULT_INTERVAL) + 1;
irdp->AdvPrefList = list_new();
irdp->AdvPrefList->del = (void (*)(void *))Adv_free; /* Destructor */