summaryrefslogtreecommitdiff
path: root/networking/udhcp/clientsocket.c
diff options
context:
space:
mode:
authorDenis Vlasenko2006-11-18 19:51:32 +0000
committerDenis Vlasenko2006-11-18 19:51:32 +0000
commit5a3395bc01cd4b11309595a6ecdaf32f8279f378 (patch)
tree1e63aa591a05e9ec75aefdcd639ca4188e583648 /networking/udhcp/clientsocket.c
parentabfc4cf6d8b9c59724aceb70df5081a1368fdb62 (diff)
downloadbusybox-5a3395bc01cd4b11309595a6ecdaf32f8279f378.zip
busybox-5a3395bc01cd4b11309595a6ecdaf32f8279f378.tar.gz
udhcp: fix indentation and style.
Eliminate (group) a lot of smallish *.h files Remove lots of unneeded #includes
Diffstat (limited to 'networking/udhcp/clientsocket.c')
-rw-r--r--networking/udhcp/clientsocket.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/networking/udhcp/clientsocket.c b/networking/udhcp/clientsocket.c
index 6aa6175..8520619 100644
--- a/networking/udhcp/clientsocket.c
+++ b/networking/udhcp/clientsocket.c
@@ -21,10 +21,6 @@
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <unistd.h>
-#include <netinet/in.h>
#include <features.h>
#if (__GLIBC__ >= 2 && __GLIBC_MINOR__ >= 1) || defined(_NEWLIB_VERSION)
#include <netpacket/packet.h>
@@ -35,7 +31,6 @@
#include <linux/if_ether.h>
#endif
-#include "clientsocket.h"
#include "common.h"
@@ -45,7 +40,8 @@ int raw_socket(int ifindex)
struct sockaddr_ll sock;
DEBUG("Opening raw socket on ifindex %d", ifindex);
- if ((fd = socket(PF_PACKET, SOCK_DGRAM, htons(ETH_P_IP))) < 0) {
+ fd = socket(PF_PACKET, SOCK_DGRAM, htons(ETH_P_IP));
+ if (fd < 0) {
bb_perror_msg("socket");
return -1;
}
@@ -54,7 +50,7 @@ int raw_socket(int ifindex)
sock.sll_protocol = htons(ETH_P_IP);
sock.sll_ifindex = ifindex;
if (bind(fd, (struct sockaddr *) &sock, sizeof(sock)) < 0) {
- bb_perror_msg("bind:");
+ bb_perror_msg("bind");
close(fd);
return -1;
}