1
0
Fork 0
mirror of https://github.com/albfan/miraclecast.git synced 2025-03-09 23:38:56 +00:00

Lease IP on REQUEST if address is free

Signed-off-by: Andrey Gusakov <andrey.gusakov@cogentembedded.com>
This commit is contained in:
Andrey Gusakov 2014-08-04 10:46:05 +04:00 committed by albfan
parent 7d936b3cdf
commit 6de9b112d8

View file

@ -702,6 +702,12 @@ static gboolean listener_event(GIOChannel *channel, GIOCondition condition,
break;
}
if (!lease) {
/* check if requested address free */
lease = add_lease(dhcp_server, OFFER_TIME,
packet.chaddr, htonl(requested_nip));
}
if (lease && requested_nip == lease->lease_nip) {
debug(dhcp_server, "Sending ACK");
send_ACK(dhcp_server, &packet,