udhcp: shorten mac len from 16 to 6 in lease file

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
Denys Vlasenko
2009-06-17 11:57:09 +02:00
parent ac906fa85e
commit 31af3d5a1d
15 changed files with 126 additions and 103 deletions

View File

@ -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;