Quagga: Fix code to use srandom/random
Quagga was using a mix of srand/rand and srandom/random.
Consolidate to use srandom/random which are the POSIX
versions of random number generators
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
diff --git a/bgpd/bgp_routemap.c b/bgpd/bgp_routemap.c
index 5467cfd..20bf2eb 100644
--- a/bgpd/bgp_routemap.c
+++ b/bgpd/bgp_routemap.c
@@ -884,12 +884,7 @@
route_match_probability (void *rule, struct prefix *prefix,
route_map_object_t type, void *object)
{
- long r;
-#if _SVID_SOURCE || _BSD_SOURCE || _XOPEN_SOURCE >= 500
- r = random();
-#else
- r = (long) rand();
-#endif
+ long r = random();
switch (*(long *) rule)
{
@@ -911,12 +906,6 @@
long *lobule;
unsigned perc;
-#if _SVID_SOURCE || _BSD_SOURCE || _XOPEN_SOURCE >= 500
- srandom (time (NULL));
-#else
- srand (time (NULL));
-#endif
-
perc = atoi (arg);
lobule = XMALLOC (MTYPE_ROUTE_MAP_COMPILED, sizeof (long));