diff --git a/examples/platforms/posix/random.c b/examples/platforms/posix/random.c index 09dce589a..72a27a4c5 100644 --- a/examples/platforms/posix/random.c +++ b/examples/platforms/posix/random.c @@ -34,6 +34,7 @@ * This implementation is not a true random number generator and does @em satisfy the Thread requirements. */ +#include #include #include @@ -44,7 +45,8 @@ static uint32_t s_state = 1; void posixRandomInit(void) { - s_state = NODE_ID; + // Multiplying NODE_ID assures that no two nodes gets the same seed within an hour. + s_state = (uint32_t)time(NULL) + (3600 * NODE_ID); } uint32_t otPlatRandomGet(void)