summaryrefslogtreecommitdiff
path: root/networking/udhcp/dhcpc.c
diff options
context:
space:
mode:
authorDenys Vlasenko2009-06-17 11:57:09 +0200
committerDenys Vlasenko2009-06-17 11:57:09 +0200
commit31af3d5a1dbc750d8646f948ce642e6ae57ce880 (patch)
tree37d72b13f986b1da25def340771b49be4dd3028b /networking/udhcp/dhcpc.c
parentac906fa85e61b4e34161709de777616f858bc945 (diff)
downloadbusybox-31af3d5a1dbc750d8646f948ce642e6ae57ce880.zip
busybox-31af3d5a1dbc750d8646f948ce642e6ae57ce880.tar.gz
udhcp: shorten mac len from 16 to 6 in lease file
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'networking/udhcp/dhcpc.c')
-rw-r--r--networking/udhcp/dhcpc.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/networking/udhcp/dhcpc.c b/networking/udhcp/dhcpc.c
index eed9d9a..41bb0b0 100644
--- a/networking/udhcp/dhcpc.c
+++ b/networking/udhcp/dhcpc.c
@@ -149,7 +149,7 @@ int udhcpc_main(int argc UNUSED_PARAM, char **argv)
int max_fd;
int retval;
struct timeval tv;
- struct dhcpMessage packet;
+ struct dhcp_packet packet;
fd_set rfds;
#if ENABLE_GETOPT_LONG
@@ -498,7 +498,9 @@ int udhcpc_main(int argc UNUSED_PARAM, char **argv)
}
/* Ignore packets that aren't for us */
- if (memcmp(packet.chaddr, client_config.client_mac, 6)) {
+ if (packet.hlen != 6
+ || memcmp(packet.chaddr, client_config.client_mac, 6)
+ ) {
//FIXME: need to also check that last 10 bytes are zero
log1("chaddr does not match, ignoring packet"); // log2?
continue;