diff options
Diffstat (limited to 'networking/udhcp/clientpacket.c')
-rw-r--r-- | networking/udhcp/clientpacket.c | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/networking/udhcp/clientpacket.c b/networking/udhcp/clientpacket.c index 86faec925..7debac2ef 100644 --- a/networking/udhcp/clientpacket.c +++ b/networking/udhcp/clientpacket.c | |||
@@ -35,17 +35,13 @@ | |||
35 | #include <unistd.h> | 35 | #include <unistd.h> |
36 | #include <netinet/in.h> | 36 | #include <netinet/in.h> |
37 | #include <arpa/inet.h> | 37 | #include <arpa/inet.h> |
38 | #include <errno.h> | ||
39 | #include <sys/types.h> | ||
40 | #include <sys/stat.h> | ||
41 | #include <fcntl.h> | 38 | #include <fcntl.h> |
42 | 39 | ||
43 | 40 | ||
44 | #include "dhcpd.h" | 41 | #include "dhcpd.h" |
45 | #include "packet.h" | ||
46 | #include "options.h" | 42 | #include "options.h" |
47 | #include "dhcpc.h" | 43 | #include "dhcpc.h" |
48 | #include "debug.h" | 44 | #include "common.h" |
49 | 45 | ||
50 | 46 | ||
51 | /* Create a random xid */ | 47 | /* Create a random xid */ |
@@ -58,8 +54,7 @@ unsigned long random_xid(void) | |||
58 | 54 | ||
59 | fd = open("/dev/urandom", 0); | 55 | fd = open("/dev/urandom", 0); |
60 | if (fd < 0 || read(fd, &seed, sizeof(seed)) < 0) { | 56 | if (fd < 0 || read(fd, &seed, sizeof(seed)) < 0) { |
61 | LOG(LOG_WARNING, "Could not load seed from /dev/urandom: %s", | 57 | LOG(LOG_WARNING, "Could not load seed from /dev/urandom: %m"); |
62 | strerror(errno)); | ||
63 | seed = time(0); | 58 | seed = time(0); |
64 | } | 59 | } |
65 | if (fd >= 0) close(fd); | 60 | if (fd >= 0) close(fd); |
@@ -250,4 +245,3 @@ int get_raw_packet(struct dhcpMessage *payload, int fd) | |||
250 | return bytes - (sizeof(packet.ip) + sizeof(packet.udp)); | 245 | return bytes - (sizeof(packet.ip) + sizeof(packet.udp)); |
251 | 246 | ||
252 | } | 247 | } |
253 | |||