udhcp: slight shrink
udhcpd_main 1171 1208 +37
udhcpc_main 2363 2387 +24
dhcprelay_main 1145 1146 +1
dhcprelay_stopflag 4 1 -3
dhcprelay_signal_handler 11 8 -3
client_background 46 42 -4
udhcp_read_interface 230 211 -19
udhcp_make_pidfile 76 - -76
------------------------------------------------------------------------------
(add/remove: 0/1 grow/shrink: 3/4 up/down: 62/-105) Total: -43 bytes
text data bss dec hex filename
770052 1096 11228 782376 bf028 busybox_old
769980 1096 11228 782304 befe0 busybox_unstripped
diff --git a/networking/udhcp/socket.c b/networking/udhcp/socket.c
index 648f762..1e62f8e 100644
--- a/networking/udhcp/socket.c
+++ b/networking/udhcp/socket.c
@@ -44,11 +44,11 @@
struct sockaddr_in *our_ip;
memset(&ifr, 0, sizeof(ifr));
- fd = socket(AF_INET, SOCK_RAW, IPPROTO_RAW);
- if (fd < 0) {
- bb_perror_msg("socket failed");
- return -1;
- }
+ fd = xsocket(AF_INET, SOCK_RAW, IPPROTO_RAW);
+// if (fd < 0) {
+// bb_perror_msg("socket failed");
+// return -1;
+// }
ifr.ifr_addr.sa_family = AF_INET;
strncpy(ifr.ifr_name, interface, sizeof(ifr.ifr_name));
@@ -83,6 +83,7 @@
arp[0], arp[1], arp[2], arp[3], arp[4], arp[5]);
}
+ close(fd);
return 0;
}