diff options
author | Denis Vlasenko <vda.linux@googlemail.com> | 2008-05-26 17:32:35 +0000 |
---|---|---|
committer | Denis Vlasenko <vda.linux@googlemail.com> | 2008-05-26 17:32:35 +0000 |
commit | fc9e1080320e52fb97ae694627d8101af64f3dad (patch) | |
tree | 2b57edddb15071f8fa13a47e45a735d0e8c52edc /include | |
parent | 6bb55cfb99090565d565588c281c08ca21993e78 (diff) |
udhcpc: shrink
udhcpc: guard against zero lease time
function old new delta
timeout 4 - -4
server_addr 4 - -4
requested_ip 4 - -4
perform_release 134 112 -22
udhcpc_main 2511 2485 -26
------------------------------------------------------------------------------
(add/remove: 0/3 grow/shrink: 0/2 up/down: 0/-60) Total: -60 bytes
Diffstat (limited to 'include')
-rw-r--r-- | include/platform.h | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/include/platform.h b/include/platform.h index 0e0ccaf90..21224fabf 100644 --- a/include/platform.h +++ b/include/platform.h @@ -135,7 +135,18 @@ #define SWAP_LE64(x) (x) #endif +/* ---- Unaligned access ------------------------------------ */ + +/* parameter is supposed to be an uint32_t* ptr */ +#if defined(i386) || defined(__x86_64__) /* + other arches? */ +#define get_unaligned_u32p(u32p) (*(u32p)) +#else +/* performs reasonably well (gcc usually inlines memcpy here) */ +#define get_unaligned_u32p(u32p) ({ uint32_t __t; memcpy(&__t, (u32p), 4); __t; }) +#endif + /* ---- Networking ------------------------------------------ */ + #ifndef __APPLE__ # include <arpa/inet.h> # ifndef __socklen_t_defined @@ -146,6 +157,7 @@ typedef int socklen_t; #endif /* ---- Compiler dependent settings ------------------------- */ + #if (defined __digital__ && defined __unix__) || defined __APPLE__ # undef HAVE_MNTENT_H # undef HAVE_SYS_STATFS_H @@ -163,9 +175,10 @@ __extension__ typedef unsigned long long __u64; #endif /*----- Kernel versioning ------------------------------------*/ + #define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c)) -/* ---- miscellaneous --------------------------------------- */ +/* ---- Miscellaneous --------------------------------------- */ #if defined(__GNU_LIBRARY__) && __GNU_LIBRARY__ < 5 && \ !defined(__dietlibc__) && \ |