From ab2f22f03786995406fd5b894addccfa9e5aff53 Mon Sep 17 00:00:00 2001 From: Saravanakumar Gandhi Date: Fri, 15 Mar 2013 18:21:10 +0530 Subject: [PATCH] Modified set_rand_dhcp_xid() to generate random DHCP xid if the dhtest is called multiple times within a second --- dhtest.c | 1 + functions.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/dhtest.c b/dhtest.c index a1f9471..08981e2 100644 --- a/dhtest.c +++ b/dhtest.c @@ -7,6 +7,7 @@ #include #include #include +#include #include #include #include diff --git a/functions.c b/functions.c index 67c773f..d55f365 100644 --- a/functions.c +++ b/functions.c @@ -328,7 +328,7 @@ int reset_dhopt_size() int set_rand_dhcp_xid() { if(dhcp_xid == 0) { - srand(time(NULL)); + srand(time(NULL) ^ (getpid() << 16)); dhcp_xid = rand() % 0xffffffff; } return 0;