diff options
| author | Rafael Zalamena <rzalamena@opensourcerouting.org> | 2020-04-17 10:35:15 -0300 | 
|---|---|---|
| committer | Rafael Zalamena <rzalamena@opensourcerouting.org> | 2020-04-17 20:57:43 -0300 | 
| commit | 5920b3eb38a6cfd1c9b87106aa7403171408f0bd (patch) | |
| tree | fe6c96488ab537bebfeb07f658b4d500ba20c446 /pimd/pim_pim.c | |
| parent | 4110aa2cb342fb0f025746c4b7df7707f69334c5 (diff) | |
*: 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 'pimd/pim_pim.c')
| -rw-r--r-- | pimd/pim_pim.c | 3 | 
1 files changed, 2 insertions, 1 deletions
diff --git a/pimd/pim_pim.c b/pimd/pim_pim.c index f37c140bf2..3976b262e3 100644 --- a/pimd/pim_pim.c +++ b/pimd/pim_pim.c @@ -23,6 +23,7 @@  #include "thread.h"  #include "memory.h"  #include "if.h" +#include "network.h"  #include "pimd.h"  #include "pim_pim.h" @@ -878,7 +879,7 @@ int pim_sock_add(struct interface *ifp)  	old_genid = pim_ifp->pim_generation_id;  	while (old_genid == pim_ifp->pim_generation_id) -		pim_ifp->pim_generation_id = random(); +		pim_ifp->pim_generation_id = frr_weak_random();  	zlog_info("PIM INTERFACE UP: on interface %s ifindex=%d", ifp->name,  		  ifp->ifindex);  | 
