version 1.1, 2012/02/21 22:30:18
|
version 1.1.1.1, 2012/10/09 09:06:55
|
Line 3
|
Line 3
|
Server-specific in-memory database support. */ |
Server-specific in-memory database support. */ |
|
|
/* |
/* |
|
* Copyright (c) 2011-2012 by Internet Systems Consortium, Inc. ("ISC") |
* Copyright (c) 2004-2009 by Internet Systems Consortium, Inc. ("ISC") |
* Copyright (c) 2004-2009 by Internet Systems Consortium, Inc. ("ISC") |
* Copyright (c) 1996-2003 by Internet Software Consortium |
* Copyright (c) 1996-2003 by Internet Software Consortium |
* |
* |
Line 1882 int find_lease_by_hw_addr (struct lease **lp,
|
Line 1883 int find_lease_by_hw_addr (struct lease **lp,
|
const char *file, int line) |
const char *file, int line) |
{ |
{ |
if (hwlen == 0) |
if (hwlen == 0) |
return 0; | return (0); |
return lease_id_hash_lookup(lp, lease_hw_addr_hash, hwaddr, hwlen, | |
file, line); | /* |
| * If it's an infiniband address don't bother |
| * as we don't have a useful address to hash. |
| */ |
| if ((hwlen == 1) && (hwaddr[0] == HTYPE_INFINIBAND)) |
| return (0); |
| |
| return (lease_id_hash_lookup(lp, lease_hw_addr_hash, hwaddr, hwlen, |
| file, line)); |
} |
} |
|
|
/* If the lease is preferred over the candidate, return truth. The |
/* If the lease is preferred over the candidate, return truth. The |
Line 2049 void uid_hash_delete (lease)
|
Line 2058 void uid_hash_delete (lease)
|
} |
} |
|
|
/* Add the specified lease to the hardware address hash. */ |
/* Add the specified lease to the hardware address hash. */ |
|
/* We don't add leases with infiniband addresses to the |
|
* hash as there isn't any address to hash on. */ |
|
|
void |
void |
hw_hash_add(struct lease *lease) |
hw_hash_add(struct lease *lease) |
Line 2058 hw_hash_add(struct lease *lease)
|
Line 2069 hw_hash_add(struct lease *lease)
|
struct lease *prev = NULL; |
struct lease *prev = NULL; |
struct lease *next = NULL; |
struct lease *next = NULL; |
|
|
|
/* |
|
* If it's an infiniband address don't bother |
|
* as we don't have a useful address to hash. |
|
*/ |
|
if ((lease->hardware_addr.hlen == 1) && |
|
(lease->hardware_addr.hbuf[0] == HTYPE_INFINIBAND)) |
|
return; |
|
|
/* If it's not in the hash, just add it. */ |
/* If it's not in the hash, just add it. */ |
if (!find_lease_by_hw_addr (&head, lease -> hardware_addr.hbuf, |
if (!find_lease_by_hw_addr (&head, lease -> hardware_addr.hbuf, |
lease -> hardware_addr.hlen, MDL)) |
lease -> hardware_addr.hlen, MDL)) |
Line 2128 void hw_hash_delete (lease)
|
Line 2147 void hw_hash_delete (lease)
|
{ |
{ |
struct lease *head = (struct lease *)0; |
struct lease *head = (struct lease *)0; |
struct lease *next = (struct lease *)0; |
struct lease *next = (struct lease *)0; |
|
|
|
/* |
|
* If it's an infiniband address don't bother |
|
* as we don't have a useful address to hash. |
|
*/ |
|
if ((lease->hardware_addr.hlen == 1) && |
|
(lease->hardware_addr.hbuf[0] == HTYPE_INFINIBAND)) |
|
return; |
|
|
/* If it's not in the hash, we have no work to do. */ |
/* If it's not in the hash, we have no work to do. */ |
if (!find_lease_by_hw_addr (&head, lease -> hardware_addr.hbuf, |
if (!find_lease_by_hw_addr (&head, lease -> hardware_addr.hbuf, |