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
This commit is contained in:
Denis Vlasenko
2008-05-26 17:32:35 +00:00
parent 6bb55cfb99
commit fc9e108032
3 changed files with 36 additions and 21 deletions

View File

@ -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__) && \