diff options
Diffstat (limited to 'src/ipcpd/unicast/addr-auth/flat.c')
-rw-r--r-- | src/ipcpd/unicast/addr-auth/flat.c | 19 |
1 files changed, 4 insertions, 15 deletions
diff --git a/src/ipcpd/unicast/addr-auth/flat.c b/src/ipcpd/unicast/addr-auth/flat.c index af245a5d..061cb01f 100644 --- a/src/ipcpd/unicast/addr-auth/flat.c +++ b/src/ipcpd/unicast/addr-auth/flat.c @@ -29,19 +29,11 @@ #define OUROBOROS_PREFIX "flat-addr-auth" #include <ouroboros/logs.h> -#include <ouroboros/errno.h> -#include <ouroboros/time_utils.h> -#include <ouroboros/utils.h> +#include <ouroboros/random.h> #include "ipcp.h" #include "flat.h" -#include <time.h> -#include <stdlib.h> -#include <math.h> -#include <string.h> -#include <assert.h> - #define NAME_LEN 8 struct { @@ -75,13 +67,10 @@ int flat_fini(void) uint64_t flat_address(void) { - struct timespec t; - uint32_t addr; - - clock_gettime(CLOCK_REALTIME, &t); - srand(t.tv_nsec); + uint32_t addr = INVALID_ADDRESS; - addr = (rand() % (RAND_MAX - 1) + 1) & 0xFFFFFFFF; + while (addr == INVALID_ADDRESS) + random_buffer(&addr,sizeof(addr)); return addr; } |