From 66815f7f1a53be0fbe8c6404c6d7cf018f8d5b9d Mon Sep 17 00:00:00 2001 From: Tristan Brice Velloza Kildaire Date: Sat, 14 Dec 2024 14:35:48 +0200 Subject: [PATCH] TAP - Seed random number generatro based off of current time --- TAP.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/TAP.c b/TAP.c index 8103eaf..e24fade 100644 --- a/TAP.c +++ b/TAP.c @@ -33,11 +33,14 @@ void localRand(struct in6_addr* ll_a) } } +#include + // TODO: Allow optional-arg for case where we must also generate the hwaddr // (this would be the case whereby we are running without `--ethernet`) struct in6_addr generateLinkLocal(char* interfaceName) { - srand(0); // TODO: FIXME, use time or something + time_t t = time(NULL); + srand(t); // TODO: FIXME, use time or something struct in6_addr ll_a; memset(&ll_a, 0, sizeof(struct in6_addr));