mirror of
https://gitlab.isc.org/isc-projects/dhcp
synced 2025-08-29 13:28:14 +00:00
Release DHCP lease before assigning it to BOOTP client, so as to avoid unnecessary lease conflict behaviour.
This commit is contained in:
parent
efdf1d6ec1
commit
2824de2061
13
bootp.c
13
bootp.c
@ -119,11 +119,22 @@ void bootp (packet)
|
|||||||
and it's still okay to use dynamic bootp on
|
and it's still okay to use dynamic bootp on
|
||||||
that lease, reassign it. */
|
that lease, reassign it. */
|
||||||
if (lease) {
|
if (lease) {
|
||||||
if (lease -> flags & DYNAMIC_BOOTP_OK) {
|
/* If this lease can be used for dynamic bootp,
|
||||||
|
do so. */
|
||||||
|
if ((lease -> flags & DYNAMIC_BOOTP_OK)) {
|
||||||
|
|
||||||
|
/* If it's not a DYNAMIC_BOOTP lease,
|
||||||
|
release it before reassigning it
|
||||||
|
so that we don't get a lease
|
||||||
|
conflict. */
|
||||||
|
if (!(lease -> flags & BOOTP_LEASE))
|
||||||
|
release_lease (lease);
|
||||||
|
|
||||||
lease -> host = host;
|
lease -> host = host;
|
||||||
ack_lease (packet, lease, 0, 0);
|
ack_lease (packet, lease, 0, 0);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* If dynamic BOOTP is no longer allowed for
|
/* If dynamic BOOTP is no longer allowed for
|
||||||
this lease, set it free. */
|
this lease, set it free. */
|
||||||
release_lease (lease);
|
release_lease (lease);
|
||||||
|
@ -119,11 +119,22 @@ void bootp (packet)
|
|||||||
and it's still okay to use dynamic bootp on
|
and it's still okay to use dynamic bootp on
|
||||||
that lease, reassign it. */
|
that lease, reassign it. */
|
||||||
if (lease) {
|
if (lease) {
|
||||||
if (lease -> flags & DYNAMIC_BOOTP_OK) {
|
/* If this lease can be used for dynamic bootp,
|
||||||
|
do so. */
|
||||||
|
if ((lease -> flags & DYNAMIC_BOOTP_OK)) {
|
||||||
|
|
||||||
|
/* If it's not a DYNAMIC_BOOTP lease,
|
||||||
|
release it before reassigning it
|
||||||
|
so that we don't get a lease
|
||||||
|
conflict. */
|
||||||
|
if (!(lease -> flags & BOOTP_LEASE))
|
||||||
|
release_lease (lease);
|
||||||
|
|
||||||
lease -> host = host;
|
lease -> host = host;
|
||||||
ack_lease (packet, lease, 0, 0);
|
ack_lease (packet, lease, 0, 0);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* If dynamic BOOTP is no longer allowed for
|
/* If dynamic BOOTP is no longer allowed for
|
||||||
this lease, set it free. */
|
this lease, set it free. */
|
||||||
release_lease (lease);
|
release_lease (lease);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user