diff options
author | Ted Lemon <source@isc.org> | 2001-12-07 21:55:21 +0000 |
---|---|---|
committer | Ted Lemon <source@isc.org> | 2001-12-07 21:55:21 +0000 |
commit | 44ba9ff23085d4c4b3843e4bf53f909053c5bd95 (patch) | |
tree | 269fccc1c52aa331d5b34e71a33d3c384dadf460 | |
parent | ad1201c8af5904e56804cba365761d6dfa6b8e5f (diff) | |
download | isc-dhcp-44ba9ff23085d4c4b3843e4bf53f909053c5bd95.tar.gz |
- Don't accept a DHCPRELEASE if the message doesn't contain the
correct MAC address for the client.
-rw-r--r-- | server/dhcp.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/server/dhcp.c b/server/dhcp.c index 82909553..65767ecf 100644 --- a/server/dhcp.c +++ b/server/dhcp.c @@ -43,7 +43,7 @@ #ifndef lint static char copyright[] = -"$Id: dhcp.c,v 1.192.2.16 2001/10/26 21:37:48 mellon Exp $ Copyright (c) 1995-2001 The Internet Software Consortium. All rights reserved.\n"; +"$Id: dhcp.c,v 1.192.2.17 2001/12/07 21:55:21 mellon Exp $ Copyright (c) 1995-2001 The Internet Software Consortium. All rights reserved.\n"; #endif /* not lint */ #include "dhcpd.h" @@ -713,6 +713,14 @@ void dhcprelease (packet, ms_nulltp) } + /* If the hardware address doesn't match, don't do the release. */ + if (lease && + (lease -> hardware_addr.hlen != packet -> raw -> hlen + 1 || + lease -> hardware_addr.hbuf [0] != packet -> raw -> htype || + memcmp (&lease -> hardware_addr.hbuf [0], + packet -> raw -> chaddr, packet -> raw -> hlen))) + lease_dereference (&lease, MDL); + if (lease && lease -> client_hostname && db_printable (lease -> client_hostname)) s = lease -> client_hostname; |