summaryrefslogtreecommitdiffhomepage
path: root/networking/udhcp/clientsocket.c
diff options
context:
space:
mode:
authorBernhard Reutner-Fischer <rep.dot.nop@gmail.com>2006-12-19 16:31:09 +0000
committerBernhard Reutner-Fischer <rep.dot.nop@gmail.com>2006-12-19 16:31:09 +0000
commit28fbd69bf8a0482de2816cc189fdd0e9ed551997 (patch)
treec2d7e7b1e0b9b87748cb74b52dd3599d5500feca /networking/udhcp/clientsocket.c
parent359d7ca0e70d4acfc3b7e792bf28f5b5581af8ff (diff)
- use xlisten/xsocket some more. Saves .25 kB
Diffstat (limited to 'networking/udhcp/clientsocket.c')
-rw-r--r--networking/udhcp/clientsocket.c12
1 files changed, 2 insertions, 10 deletions
diff --git a/networking/udhcp/clientsocket.c b/networking/udhcp/clientsocket.c
index b8803f04e..541f883b5 100644
--- a/networking/udhcp/clientsocket.c
+++ b/networking/udhcp/clientsocket.c
@@ -40,20 +40,12 @@ int raw_socket(int ifindex)
struct sockaddr_ll sock;
DEBUG("Opening raw socket on ifindex %d", ifindex);
- fd = socket(PF_PACKET, SOCK_DGRAM, htons(ETH_P_IP));
- if (fd < 0) {
- bb_perror_msg("socket");
- return -1;
- }
+ fd = xsocket(PF_PACKET, SOCK_DGRAM, htons(ETH_P_IP));
sock.sll_family = AF_PACKET;
sock.sll_protocol = htons(ETH_P_IP);
sock.sll_ifindex = ifindex;
- if (bind(fd, (struct sockaddr *) &sock, sizeof(sock)) < 0) {
- bb_perror_msg("bind");
- close(fd);
- return -1;
- }
+ xbind(fd, (struct sockaddr *) &sock, sizeof(sock));
return fd;
}