#ifndef lint
static char copyright[] =
-"$Id: dhcp.c,v 1.57.2.23 1999/03/29 22:29:31 mellon Exp $ Copyright (c) 1995, 1996, 1997, 1998, 1999 The Internet Software Consortium. All rights reserved.\n";
+"$Id: dhcp.c,v 1.57.2.24 1999/03/30 20:40:59 mellon Exp $ Copyright (c) 1995, 1996, 1997, 1998, 1999 The Internet Software Consortium. All rights reserved.\n";
#endif /* not lint */
#include "dhcpd.h"
}
/* If we're not allowed to serve this client anymore, don't. */
- if (!lease -> host &&
+ if (lease &&
+ !lease -> host &&
!lease -> subnet -> group -> boot_unknown_clients) {
note ("Ignoring unknown client %s",
print_hw_addr (packet -> raw -> htype,
unsigned char nak = DHCPNAK;
struct packet outgoing;
struct hardware hto;
+ int i;
struct tree_cache *options [256];
struct tree_cache dhcpnak_tree;
options [DHO_DHCP_MESSAGE] -> tree = (struct tree *)0;
/* Do not use the client's requested parameter list. */
- packet -> options [DHO_DHCP_PARAMETER_REQUEST_LIST].len = 0;
- packet -> options [DHO_DHCP_PARAMETER_REQUEST_LIST].data =
- (unsigned char *)0;
+ i = DHO_DHCP_PARAMETER_REQUEST_LIST;
+ if (packet -> options [i].data) {
+ packet -> options [i].len = 0;
+ dfree (packet -> options [i].data, "nak_lease");
+ packet -> options [i].data = (unsigned char *)0;
+ }
/* Set up the option buffer... */
outgoing.packet_length =