aboutsummaryrefslogtreecommitdiff
path: root/networking/udhcp/dumpleases.c
diff options
context:
space:
mode:
Diffstat (limited to 'networking/udhcp/dumpleases.c')
-rw-r--r--networking/udhcp/dumpleases.c13
1 files changed, 1 insertions, 12 deletions
diff --git a/networking/udhcp/dumpleases.c b/networking/udhcp/dumpleases.c
index 2eaadb6eb..46610fc63 100644
--- a/networking/udhcp/dumpleases.c
+++ b/networking/udhcp/dumpleases.c
@@ -6,17 +6,6 @@
6#include "dhcpd.h" 6#include "dhcpd.h"
7#include "unicode.h" 7#include "unicode.h"
8 8
9#if BB_LITTLE_ENDIAN
10static inline uint64_t hton64(uint64_t v)
11{
12 return (((uint64_t)htonl(v)) << 32) | htonl(v >> 32);
13}
14#else
15#define hton64(v) (v)
16#endif
17#define ntoh64(v) hton64(v)
18
19
20int dumpleases_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; 9int dumpleases_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
21int dumpleases_main(int argc UNUSED_PARAM, char **argv) 10int dumpleases_main(int argc UNUSED_PARAM, char **argv)
22{ 11{
@@ -54,7 +43,7 @@ int dumpleases_main(int argc UNUSED_PARAM, char **argv)
54 /* "123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 */ 43 /* "123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 */
55 44
56 xread(fd, &written_at, sizeof(written_at)); 45 xread(fd, &written_at, sizeof(written_at));
57 written_at = ntoh64(written_at); 46 written_at = SWAP_BE64(written_at);
58 curr = time(NULL); 47 curr = time(NULL);
59 if (curr < written_at) 48 if (curr < written_at)
60 written_at = curr; /* lease file from future! :) */ 49 written_at = curr; /* lease file from future! :) */