Change netdev_get_in4() to re-check the IP address on each call.
[sliver-openvswitch.git] / lib / random.c
index 55507e0..c7a3edf 100644 (file)
@@ -31,6 +31,7 @@
  * derivatives without specific, written prior permission.
  */
 
+#include <config.h>
 #include "random.h"
 
 #include <errno.h>
@@ -70,3 +71,9 @@ random_uint32(void)
     random_bytes(&x, sizeof x);
     return x;
 }
+
+int
+random_range(int max) 
+{
+    return random_uint32() % max;
+}