summaryrefslogtreecommitdiff
path: root/networking/udhcp/packet.c
diff options
context:
space:
mode:
authorGlenn L McGrath2003-06-10 17:22:49 +0000
committerGlenn L McGrath2003-06-10 17:22:49 +0000
commit24833430bc2dbea733c3b0b9ea6c6b976f95474a (patch)
tree805a4197b8a0d36eaa6880dfc23d8c2539359fe9 /networking/udhcp/packet.c
parent6c43f743a3f607f91ee22a53db880fce2df645f0 (diff)
downloadbusybox-24833430bc2dbea733c3b0b9ea6c6b976f95474a.zip
busybox-24833430bc2dbea733c3b0b9ea6c6b976f95474a.tar.gz
Vodz, last_patch_88
Diffstat (limited to 'networking/udhcp/packet.c')
-rw-r--r--networking/udhcp/packet.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/networking/udhcp/packet.c b/networking/udhcp/packet.c
index d9f7159..0f2a3bc 100644
--- a/networking/udhcp/packet.c
+++ b/networking/udhcp/packet.c
@@ -14,10 +14,9 @@
#endif
#include <errno.h>
-#include "packet.h"
-#include "debug.h"
#include "dhcpd.h"
#include "options.h"
+#include "common.h"
void init_header(struct dhcpMessage *packet, char type)
@@ -123,7 +122,7 @@ int raw_packet(struct dhcpMessage *payload, u_int32_t source_ip, int source_port
struct udp_dhcp_packet packet;
if ((fd = socket(PF_PACKET, SOCK_DGRAM, htons(ETH_P_IP))) < 0) {
- DEBUG(LOG_ERR, "socket call failed: %s", strerror(errno));
+ DEBUG(LOG_ERR, "socket call failed: %m");
return -1;
}
@@ -136,7 +135,7 @@ int raw_packet(struct dhcpMessage *payload, u_int32_t source_ip, int source_port
dest.sll_halen = 6;
memcpy(dest.sll_addr, dest_arp, 6);
if (bind(fd, (struct sockaddr *)&dest, sizeof(struct sockaddr_ll)) < 0) {
- DEBUG(LOG_ERR, "bind call failed: %s", strerror(errno));
+ DEBUG(LOG_ERR, "bind call failed: %m");
close(fd);
return -1;
}
@@ -159,7 +158,7 @@ int raw_packet(struct dhcpMessage *payload, u_int32_t source_ip, int source_port
result = sendto(fd, &packet, sizeof(struct udp_dhcp_packet), 0, (struct sockaddr *) &dest, sizeof(dest));
if (result <= 0) {
- DEBUG(LOG_ERR, "write on socket failed: %s", strerror(errno));
+ DEBUG(LOG_ERR, "write on socket failed: %m");
}
close(fd);
return result;
@@ -200,4 +199,3 @@ int kernel_packet(struct dhcpMessage *payload, u_int32_t source_ip, int source_p
close(fd);
return result;
}
-