#ifndef lint
static char copyright[] =
-"$Id: mdb.c,v 1.26 2000/01/26 14:56:18 mellon Exp $ Copyright (c) 1995, 1996, 1997, 1998, 1999 The Internet Software Consortium. All rights reserved.\n";
+"$Id: mdb.c,v 1.27 2000/03/06 23:35:16 mellon Exp $ Copyright (c) 1995, 1996, 1997, 1998, 1999 The Internet Software Consortium. All rights reserved.\n";
#endif /* not lint */
#include "dhcpd.h"
struct executable_statement *esp;
if (!host_name_hash) {
- host_name_hash = new_hash ();
+ host_name_hash = new_hash (0, 0);
if (!host_name_hash)
log_fatal ("Can't allocate host name hash");
} else {
if (hd -> interface.hlen) {
if (!host_hw_addr_hash) {
- host_hw_addr_hash = new_hash ();
+ host_hw_addr_hash = new_hash (0, 0);
if (!host_hw_addr_hash)
log_fatal ("Can't allocate host/hw hash");
} else
/* If there's no uid hash, make one; otherwise, see if
there's already an entry in the hash for this host. */
if (!host_uid_hash) {
- host_uid_hash = new_hash ();
+ host_uid_hash = new_hash (0, 0);
if (!host_uid_hash)
log_fatal ("Can't allocate host/uid hash");
hp = (struct host_decl *)0;
unsigned hlen;
{
struct host_decl *foo;
+ struct hardware h;
+
+ h.hlen = hlen + 1;
+ h.hbuf [0] = htype;
+ memcpy (&h.hbuf [1], haddr, hlen);
foo = (struct host_decl *)hash_lookup (host_hw_addr_hash,
- haddr, hlen);
+ h.hbuf, h.hlen);
return foo;
}
}
}
} else {
- group_name_hash = new_hash ();
+ group_name_hash = new_hash (0, 0);
t = (struct group_object *)0;
}
/* Initialize the hash table if it hasn't been done yet. */
if (!lease_uid_hash) {
- lease_uid_hash = new_hash ();
+ lease_uid_hash = new_hash (0, 0);
if (!lease_uid_hash)
log_fatal ("Can't allocate lease/uid hash");
}
if (!lease_ip_addr_hash) {
- lease_ip_addr_hash = new_hash ();
+ lease_ip_addr_hash = new_hash (0, 0);
if (!lease_uid_hash)
log_fatal ("Can't allocate lease/ip hash");
}
if (!lease_hw_addr_hash) {
- lease_hw_addr_hash = new_hash ();
+ lease_hw_addr_hash = new_hash (0, 0);
if (!lease_uid_hash)
log_fatal ("Can't allocate lease/hw hash");
}
const unsigned char *hwaddr;
unsigned hwlen;
{
- struct lease *lease = (struct lease *)hash_lookup (lease_hw_addr_hash,
- hwaddr, hwlen);
+ struct lease *lease;
+
+ lease = (struct lease *)hash_lookup (lease_hw_addr_hash,
+ hwaddr, hwlen);
return lease;
}