mirror of
https://gitlab.isc.org/isc-projects/dhcp
synced 2025-09-04 08:15:14 +00:00
Check address ranges to see if they're on the right net (previously we just silently made them be on the right net, with interesting results). In supersede_leases, don't copy offered_expiry anymore since it's now in the state structure
This commit is contained in:
@@ -42,7 +42,7 @@
|
|||||||
|
|
||||||
#ifndef lint
|
#ifndef lint
|
||||||
static char copyright[] =
|
static char copyright[] =
|
||||||
"$Id: memory.c,v 1.24 1997/03/05 06:34:36 mellon Exp $ Copyright (c) 1995, 1996 The Internet Software Consortium. All rights reserved.\n";
|
"$Id: memory.c,v 1.25 1997/03/06 06:53:49 mellon Exp $ Copyright (c) 1995, 1996 The Internet Software Consortium. All rights reserved.\n";
|
||||||
#endif /* not lint */
|
#endif /* not lint */
|
||||||
|
|
||||||
#include "dhcpd.h"
|
#include "dhcpd.h"
|
||||||
@@ -229,6 +229,15 @@ void new_address_range (low, high, subnet, dynamic)
|
|||||||
lowbuf, highbuf, netbuf, "multiple subnets");
|
lowbuf, highbuf, netbuf, "multiple subnets");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Make sure that the addresses are on the correct subnet. */
|
||||||
|
if (!addr_eq (net, subnet -> net)) {
|
||||||
|
strcpy (lowbuf, piaddr (low));
|
||||||
|
strcpy (highbuf, piaddr (high));
|
||||||
|
strcpy (netbuf, piaddr (subnet -> netmask));
|
||||||
|
error ("Address range %s to %s not on net %s/%s!",
|
||||||
|
lowbuf, highbuf, piaddr (subnet -> net), netbuf);
|
||||||
|
}
|
||||||
|
|
||||||
/* Get the high and low host addresses... */
|
/* Get the high and low host addresses... */
|
||||||
max = host_addr (high, subnet -> netmask);
|
max = host_addr (high, subnet -> netmask);
|
||||||
min = host_addr (low, subnet -> netmask);
|
min = host_addr (low, subnet -> netmask);
|
||||||
@@ -489,7 +498,6 @@ int supersede_lease (comp, lease, commit)
|
|||||||
|
|
||||||
/* Copy the data files, but not the linkages. */
|
/* Copy the data files, but not the linkages. */
|
||||||
comp -> starts = lease -> starts;
|
comp -> starts = lease -> starts;
|
||||||
comp -> offered_expiry = lease -> offered_expiry;
|
|
||||||
comp -> timestamp = lease -> timestamp;
|
comp -> timestamp = lease -> timestamp;
|
||||||
if (lease -> uid) {
|
if (lease -> uid) {
|
||||||
if (lease -> uid_len < sizeof (lease -> uid_buf)) {
|
if (lease -> uid_len < sizeof (lease -> uid_buf)) {
|
||||||
|
Reference in New Issue
Block a user