X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=lib%2Frandom.c;h=c7a3edf7468edd9fd17a759cd59ee50edfba9ff5;hb=16c4a745d76f9d4bc119474f4caa5b11ec3df190;hp=55507e027ed30aa58cff2723cfc51afaff5c2028;hpb=7225d06a782d071a05362f356b81fdc060aa8981;p=sliver-openvswitch.git diff --git a/lib/random.c b/lib/random.c index 55507e027..c7a3edf74 100644 --- a/lib/random.c +++ b/lib/random.c @@ -31,6 +31,7 @@ * derivatives without specific, written prior permission. */ +#include #include "random.h" #include @@ -70,3 +71,9 @@ random_uint32(void) random_bytes(&x, sizeof x); return x; } + +int +random_range(int max) +{ + return random_uint32() % max; +}