aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrew Zaborowski <andrew.zaborowski@intel.com>2022-07-01 15:32:34 +0200
committerDenis Kenzior <denkenz@gmail.com>2022-07-01 10:11:06 -0500
commitae663f5cb0341db25b1dc97d3882ce7dad46afae (patch)
tree9d9815355ee83051e7b3c7e23c00846e90105f7d
parent4bd98af1f295b62227a6bc7f94649eb663c0b9c1 (diff)
dhcp: Set lease->bound_time before emitting event
The event handler for L_DHCP_CLIENT_EVENT_LEASE_OBTAINED/RENEWED will want to use the new lease->bound_time value for expiry time calculation to we need to set it before we emit the events in the DHCP ACK handler.
-rw-r--r--ell/dhcp.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/ell/dhcp.c b/ell/dhcp.c
index f9c08261..afd5c34f 100644
--- a/ell/dhcp.c
+++ b/ell/dhcp.c
@@ -898,6 +898,7 @@ static void dhcp_client_rx_message(const void *data, size_t len, void *userdata,
CLIENT_ENTER_STATE(DHCP_STATE_BOUND);
l_timeout_remove(client->timeout_resend);
client->timeout_resend = NULL;
+ client->lease->bound_time = timestamp;
if (client->transport->bind) {
e = client->transport->bind(client->transport,
@@ -910,8 +911,6 @@ static void dhcp_client_rx_message(const void *data, size_t len, void *userdata,
dhcp_client_event_notify(client, r);
- client->lease->bound_time = timestamp;
-
/*
* Start T1, once it expires we will start the T2 timer. If
* we renew the lease, we will end up back here.