Skip to contentSkip to conversation

dhcp6: Switch to BOUND before LEASE_OBTAINED

PATCH Applied Andrew Zaborowski 2 participants 2 messages Nov 8, 2021

lore
Share & tools
lore

Andrew Zaborowski

author
#0 lore raw

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
index 67d4628..7dfc664 100644
@@ -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
Applied
#1 lore raw

Hi Andrew,

Quoted 11 lines · Andrew Zaborowski

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(-)

Applied, thanks.

Regards,
-Denis