mirror of
https://gitlab.isc.org/isc-projects/dhcp
synced 2025-09-01 06:45:27 +00:00
Fix some host references.
This commit is contained in:
@@ -43,7 +43,7 @@
|
|||||||
|
|
||||||
#ifndef lint
|
#ifndef lint
|
||||||
static char copyright[] =
|
static char copyright[] =
|
||||||
"$Id: dhcp.c,v 1.190 2001/04/18 18:58:39 mellon Exp $ Copyright (c) 1995-2001 The Internet Software Consortium. All rights reserved.\n";
|
"$Id: dhcp.c,v 1.191 2001/04/27 21:32:48 mellon Exp $ Copyright (c) 1995-2001 The Internet Software Consortium. All rights reserved.\n";
|
||||||
#endif /* not lint */
|
#endif /* not lint */
|
||||||
|
|
||||||
#include "dhcpd.h"
|
#include "dhcpd.h"
|
||||||
@@ -1619,7 +1619,7 @@ void ack_lease (packet, lease, offer, when, msg, ms_nulltp)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (h)
|
if (h)
|
||||||
host_reference (&lease -> host, hp, MDL);
|
host_reference (&lease -> host, h, MDL);
|
||||||
}
|
}
|
||||||
if (hp)
|
if (hp)
|
||||||
host_dereference (&hp, MDL);
|
host_dereference (&hp, MDL);
|
||||||
@@ -3250,11 +3250,22 @@ int find_lease (struct lease **lp,
|
|||||||
hang it off the lease so that we can use the supplied
|
hang it off the lease so that we can use the supplied
|
||||||
options. */
|
options. */
|
||||||
if (lease && host && !lease -> host) {
|
if (lease && host && !lease -> host) {
|
||||||
for (; host; host = host -> n_ipaddr) {
|
struct host_decl *p = (struct host_decl *)0;
|
||||||
if (!host -> fixed_addr) {
|
struct host_decl *n = (struct host_decl *)0;
|
||||||
host_reference (&lease -> host, host, MDL);
|
host_reference (&p, host, MDL);
|
||||||
|
while (p) {
|
||||||
|
if (!p -> fixed_addr) {
|
||||||
|
host_reference (&lease -> host, p, MDL);
|
||||||
|
host_dereference (&p, MDL);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
if (p -> n_ipaddr)
|
||||||
|
host_reference (&n, p -> n_ipaddr, MDL);
|
||||||
|
host_dereference (&p, MDL);
|
||||||
|
if (n) {
|
||||||
|
host_reference (&p, n, MDL);
|
||||||
|
host_dereference (&n, MDL);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user