summaryrefslogtreecommitdiff
path: root/lib/skiplist.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/skiplist.c')
-rw-r--r--lib/skiplist.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/skiplist.c b/lib/skiplist.c
index fa25770efa..2bef18f525 100644
--- a/lib/skiplist.c
+++ b/lib/skiplist.c
@@ -61,6 +61,7 @@
#include "vty.h"
#include "skiplist.h"
#include "lib_errors.h"
+#include "network.h"
DEFINE_MTYPE_STATIC(LIB, SKIP_LIST, "Skip List")
DEFINE_MTYPE_STATIC(LIB, SKIP_LIST_NODE, "Skip Node")
@@ -95,7 +96,7 @@ static int randomLevel(void)
do {
if (randomsLeft <= 0) {
- randomBits = random();
+ randomBits = frr_weak_random();
randomsLeft = BitsInRandom / 2;
}
b = randomBits & 3;
@@ -624,7 +625,7 @@ void skiplist_test(struct vty *vty)
zlog_debug("%s: (%d:%d)", __func__, i, k);
}
// keys[k] = (void *)random();
- keys[k] = (void *)scramble(k);
+ keys[k] = scramble(k);
if (skiplist_insert(l, keys[k], keys[k]))
zlog_debug("error in insert #%d,#%d", i, k);
}
@@ -649,7 +650,7 @@ void skiplist_test(struct vty *vty)
zlog_debug("<%d:%d>", i, k);
if (skiplist_delete(l, keys[k], keys[k]))
zlog_debug("error in delete");
- keys[k] = (void *)scramble(k ^ 0xf0f0f0f0);
+ keys[k] = scramble(k ^ 0xf0f0f0f0);
if (skiplist_insert(l, keys[k], keys[k]))
zlog_debug("error in insert #%d,#%d", i, k);
}