summaryrefslogtreecommitdiffstats
path: root/pimd/pim_pim.c
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@cumulusnetworks.com>2015-06-19 19:26:18 -0400
committerPaul Jakma <paul@quagga.net>2015-06-21 14:39:22 +0100
commit771626860adfc30c00f70d993ccb8f4d7c0c0c63 (patch)
tree86335b9708c5d88c1709c36386bf72d04843d6ec /pimd/pim_pim.c
parent1ed8ce47b922b71f3b3cdd661e647bbe7ed2eca7 (diff)
downloadquagga-771626860adfc30c00f70d993ccb8f4d7c0c0c63.tar.bz2
quagga-771626860adfc30c00f70d993ccb8f4d7c0c0c63.tar.xz
PIMD: Fix code to use srandom/random
pimd rolled it's own solution to random #'s, that was not terribly random. Rely on the underlying system to generate random #'s for us Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Diffstat (limited to 'pimd/pim_pim.c')
-rw-r--r--pimd/pim_pim.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/pimd/pim_pim.c b/pimd/pim_pim.c
index f8ac650d..409972d4 100644
--- a/pimd/pim_pim.c
+++ b/pimd/pim_pim.c
@@ -39,7 +39,6 @@
#include "pim_join.h"
#include "pim_assert.h"
#include "pim_msg.h"
-#include "pim_rand.h"
static int on_pim_hello_send(struct thread *t);
static int pim_hello_send(struct interface *ifp,
@@ -686,7 +685,7 @@ void pim_hello_restart_triggered(struct interface *ifp)
}
zassert(!pim_ifp->t_pim_hello_timer);
- random_msec = pim_rand_next(0, triggered_hello_delay_msec);
+ random_msec = random() % (triggered_hello_delay_msec + 1);
if (PIM_DEBUG_PIM_EVENTS) {
zlog_debug("Scheduling %d msec triggered hello on interface %s",
@@ -724,7 +723,7 @@ int pim_sock_add(struct interface *ifp)
pim_ifp->t_pim_sock_read = 0;
pim_ifp->pim_sock_creation = pim_time_monotonic_sec();
- pim_ifp->pim_generation_id = pim_rand() & (int64_t) 0xFFFFFFFF;
+ pim_ifp->pim_generation_id = random();
zlog_info("PIM INTERFACE UP: on interface %s ifindex=%d",
ifp->name, ifp->ifindex);