@@ -197,7 +197,6 @@ def _dsm_reset(self) -> None:
197
197
state machine INIT state."""
198
198
debug_msg ("Resetting DHCP state machine." , self ._debug )
199
199
self ._socket_release ()
200
- self ._dhcp_connection_setup ()
201
200
self .dhcp_server_ip = _BROADCAST_SERVER_ADDR
202
201
self ._eth .ifconfig = (
203
202
_UNASSIGNED_IP_ADDR ,
@@ -366,6 +365,7 @@ def _handle_dhcp_message(self) -> int:
366
365
raise ValueError (
367
366
"FSM can only send messages while in SELECTING or REQUESTING states."
368
367
)
368
+ self ._dhcp_connection_setup ()
369
369
message_length = self ._generate_dhcp_message (message_type = msg_type_out )
370
370
for attempt in range (4 ): # Initial attempt plus 3 retries.
371
371
if self ._renew :
@@ -431,15 +431,13 @@ def _dhcp_state_machine(self, *, blocking: bool = False) -> None:
431
431
if self ._dhcp_state == _STATE_RENEWING :
432
432
debug_msg ("FSM state is RENEWING." , self ._debug )
433
433
self ._renew = "renew"
434
- self ._dhcp_connection_setup ()
435
434
self ._start_time = time .monotonic ()
436
435
self ._dhcp_state = _STATE_REQUESTING
437
436
438
437
if self ._dhcp_state == _STATE_REBINDING :
439
438
debug_msg ("FSM state is REBINDING." , self ._debug )
440
439
self ._renew = "rebind"
441
440
self .dhcp_server_ip = _BROADCAST_SERVER_ADDR
442
- self ._dhcp_connection_setup ()
443
441
self ._start_time = time .monotonic ()
444
442
self ._dhcp_state = _STATE_REQUESTING
445
443
0 commit comments