From 31af3d5a1dbc750d8646f948ce642e6ae57ce880 Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Wed, 17 Jun 2009 11:57:09 +0200 Subject: udhcp: shorten mac len from 16 to 6 in lease file Signed-off-by: Denys Vlasenko --- networking/udhcp/dhcpc.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'networking/udhcp/dhcpc.c') 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; -- cgit v1.1