diff options
Diffstat (limited to 'networking/udhcp/clientsocket.c')
-rw-r--r-- | networking/udhcp/clientsocket.c | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/networking/udhcp/clientsocket.c b/networking/udhcp/clientsocket.c index 6aa61754d..852061968 100644 --- a/networking/udhcp/clientsocket.c +++ b/networking/udhcp/clientsocket.c | |||
@@ -21,10 +21,6 @@ | |||
21 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | 21 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
22 | */ | 22 | */ |
23 | 23 | ||
24 | #include <sys/types.h> | ||
25 | #include <sys/socket.h> | ||
26 | #include <unistd.h> | ||
27 | #include <netinet/in.h> | ||
28 | #include <features.h> | 24 | #include <features.h> |
29 | #if (__GLIBC__ >= 2 && __GLIBC_MINOR__ >= 1) || defined(_NEWLIB_VERSION) | 25 | #if (__GLIBC__ >= 2 && __GLIBC_MINOR__ >= 1) || defined(_NEWLIB_VERSION) |
30 | #include <netpacket/packet.h> | 26 | #include <netpacket/packet.h> |
@@ -35,7 +31,6 @@ | |||
35 | #include <linux/if_ether.h> | 31 | #include <linux/if_ether.h> |
36 | #endif | 32 | #endif |
37 | 33 | ||
38 | #include "clientsocket.h" | ||
39 | #include "common.h" | 34 | #include "common.h" |
40 | 35 | ||
41 | 36 | ||
@@ -45,7 +40,8 @@ int raw_socket(int ifindex) | |||
45 | struct sockaddr_ll sock; | 40 | struct sockaddr_ll sock; |
46 | 41 | ||
47 | DEBUG("Opening raw socket on ifindex %d", ifindex); | 42 | DEBUG("Opening raw socket on ifindex %d", ifindex); |
48 | if ((fd = socket(PF_PACKET, SOCK_DGRAM, htons(ETH_P_IP))) < 0) { | 43 | fd = socket(PF_PACKET, SOCK_DGRAM, htons(ETH_P_IP)); |
44 | if (fd < 0) { | ||
49 | bb_perror_msg("socket"); | 45 | bb_perror_msg("socket"); |
50 | return -1; | 46 | return -1; |
51 | } | 47 | } |
@@ -54,7 +50,7 @@ int raw_socket(int ifindex) | |||
54 | sock.sll_protocol = htons(ETH_P_IP); | 50 | sock.sll_protocol = htons(ETH_P_IP); |
55 | sock.sll_ifindex = ifindex; | 51 | sock.sll_ifindex = ifindex; |
56 | if (bind(fd, (struct sockaddr *) &sock, sizeof(sock)) < 0) { | 52 | if (bind(fd, (struct sockaddr *) &sock, sizeof(sock)) < 0) { |
57 | bb_perror_msg("bind:"); | 53 | bb_perror_msg("bind"); |
58 | close(fd); | 54 | close(fd); |
59 | return -1; | 55 | return -1; |
60 | } | 56 | } |