diff options
author | Rafael Zalamena <rzalamena@opensourcerouting.org> | 2020-04-17 15:35:15 +0200 |
---|---|---|
committer | Rafael Zalamena <rzalamena@opensourcerouting.org> | 2020-04-18 01:57:43 +0200 |
commit | 5920b3eb38a6cfd1c9b87106aa7403171408f0bd (patch) | |
tree | fe6c96488ab537bebfeb07f658b4d500ba20c446 /babeld/babel_interface.c | |
parent | Merge pull request #6248 from donaldsharp/zebra_snmp (diff) | |
download | frr-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 'babeld/babel_interface.c')
-rw-r--r-- | babeld/babel_interface.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/babeld/babel_interface.c b/babeld/babel_interface.c index 21fb48163..5d66e51fa 100644 --- a/babeld/babel_interface.c +++ b/babeld/babel_interface.c @@ -28,6 +28,7 @@ THE SOFTWARE. #include "vector.h" #include "distribute.h" #include "lib_errors.h" +#include "network.h" #include "babel_main.h" #include "util.h" @@ -1396,7 +1397,7 @@ babel_interface_allocate (void) /* All flags are unset */ babel_ifp->bucket_time = babel_now.tv_sec; babel_ifp->bucket = BUCKET_TOKENS_MAX; - babel_ifp->hello_seqno = (random() & 0xFFFF); + babel_ifp->hello_seqno = (frr_weak_random() & 0xFFFF); babel_ifp->rtt_min = 10000; babel_ifp->rtt_max = 120000; babel_ifp->max_rtt_penalty = 150; |