mirror of
https://gitlab.isc.org/isc-projects/dhcp
synced 2025-08-31 06:15:55 +00:00
Report failure in the event of a lease conflict; notice if lease database rewrite fails
This commit is contained in:
@@ -400,6 +400,7 @@ int supersede_lease (comp, lease, commit)
|
|||||||
comp -> hardware_addr.hlen))))) {
|
comp -> hardware_addr.hlen))))) {
|
||||||
warn ("Lease conflict at %s",
|
warn ("Lease conflict at %s",
|
||||||
piaddr (comp -> ip_addr));
|
piaddr (comp -> ip_addr));
|
||||||
|
return 0;
|
||||||
} else {
|
} else {
|
||||||
/* If there's a Unique ID, dissociate it from the hash
|
/* If there's a Unique ID, dissociate it from the hash
|
||||||
table if necessary, and always free it. */
|
table if necessary, and always free it. */
|
||||||
@@ -650,7 +651,8 @@ void write_leases ()
|
|||||||
write_lease (l);
|
write_lease (l);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
commit_leases ();
|
if (!commit_leases ())
|
||||||
|
error ("Can't commit leases to new database: %m");
|
||||||
}
|
}
|
||||||
|
|
||||||
void dump_subnets ()
|
void dump_subnets ()
|
||||||
|
4
memory.c
4
memory.c
@@ -400,6 +400,7 @@ int supersede_lease (comp, lease, commit)
|
|||||||
comp -> hardware_addr.hlen))))) {
|
comp -> hardware_addr.hlen))))) {
|
||||||
warn ("Lease conflict at %s",
|
warn ("Lease conflict at %s",
|
||||||
piaddr (comp -> ip_addr));
|
piaddr (comp -> ip_addr));
|
||||||
|
return 0;
|
||||||
} else {
|
} else {
|
||||||
/* If there's a Unique ID, dissociate it from the hash
|
/* If there's a Unique ID, dissociate it from the hash
|
||||||
table if necessary, and always free it. */
|
table if necessary, and always free it. */
|
||||||
@@ -650,7 +651,8 @@ void write_leases ()
|
|||||||
write_lease (l);
|
write_lease (l);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
commit_leases ();
|
if (!commit_leases ())
|
||||||
|
error ("Can't commit leases to new database: %m");
|
||||||
}
|
}
|
||||||
|
|
||||||
void dump_subnets ()
|
void dump_subnets ()
|
||||||
|
Reference in New Issue
Block a user