Modified set_rand_dhcp_xid() to generate random DHCP xid if the dhtest is called multiple times within a second

remotes/origin/HEAD
Saravanakumar Gandhi 14 years ago
parent 46d6d71d34
commit ab2f22f037

@ -7,6 +7,7 @@
#include<stdio.h>
#include<string.h>
#include<sys/types.h>
#include<unistd.h>
#include<sys/socket.h>
#include<net/if.h>
#include<linux/if_packet.h>

@ -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;

Loading…
Cancel
Save