dhcp6: Switch to BOUND before LEASE_OBTAINED
Andrew Zaborowski
PATCH 1/1 dhcp6: Switch to BOUND before LEASE_OBTAINED
Reorder actions so that when we obtain the lease, we first switch to DHCP6_STATE_BOUND and configure the address + emit L_DHCP6_CLIENT_EVENT_LEASE_OBTAINED after that. This allows the event handler to use l_dhcp6_client_get_lease(). l_dhcp6_client_get_lease is hardwired to return NULL in DHCP6_STATE_REQUESTING.
Issue reported by Térence Clastres.
--- ell/dhcp6.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
ell/dhcp6.c +1 -1
@@ -1401,8 +1401,8 @@ static void dhcp6_client_rx_message(const void *data, size_t len,if (r ==DHCP6_STATE_BOUND ) {l_timeout_remove (client->timeout_send); client->timeout_send =NULL ; -dhcp6_client_setup_lease (client);dhcp6_client_new_transaction (client, r); +dhcp6_client_setup_lease (client);return ; }
Signature · 1 line
2.32.0
Denis Kenzior
AppliedHi Andrew,
Quoted 11 lines · Andrew Zaborowski
Reorder actions so that when we obtain the lease, we first switch to
DHCP6_STATE_BOUNDand configure the address + emitL_DHCP6_CLIENT_EVENT_LEASE_OBTAINEDafter that. This allows the event handler to usel_dhcp6_client_get_lease().l_dhcp6_client_get_leaseis hardwired to return NULL inDHCP6_STATE_REQUESTING.Issue reported by Térence Clastres.
--- ell/dhcp6.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Applied, thanks.
Regards,
-Denis