udhcp: fix oversized packet sending (introduced by "slack for bad dhcp servers" options);

slight optimizations and function renaming

udhcp_send_raw_packet                                  -     391    +391
udhcp_send_kernel_packet                               -     197    +197
udhcp_recv_packet                                      -     134    +134
get_raw_packet                                       353     326     -27
udhcp_get_packet                                     134       -    -134
udhcp_kernel_packet                                  197       -    -197
udhcp_raw_packet                                     391       -    -391
------------------------------------------------------------------------------
(add/remove: 3/3 grow/shrink: 0/1 up/down: 722/-749)          Total: -27 bytes
This commit is contained in:
Denis Vlasenko
2007-12-20 21:11:38 +00:00
parent f77f369ce8
commit fff145dba3
7 changed files with 49 additions and 43 deletions

View File

@@ -451,7 +451,7 @@ int udhcpc_main(int argc, char **argv)
/* A packet is ready, read it */
if (listen_mode == LISTEN_KERNEL)
len = udhcp_get_packet(&packet, sockfd);
len = udhcp_recv_packet(&packet, sockfd);
else len = get_raw_packet(&packet, sockfd);
if (len == -1 && errno != EINTR) {