Skip to content

Commit 75f0194

Browse files
committed
quick patch to address bad handling of timeout response
1 parent 9d5f098 commit 75f0194

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

adafruit_wiznet5k/adafruit_wiznet5k_dhcp.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,11 @@ def request_dhcp_lease(self):
288288
((time.monotonic() - start_time) / 1000))
289289
self._dhcp_state = STATE_DHCP_DISCOVER
290290
elif self._dhcp_state == STATE_DHCP_DISCOVER:
291-
msg_type, xid = self.parse_dhcp_response(self._timeout)
291+
resp = self.parse_dhcp_response(self._timeout)
292+
if resp == 255:
293+
print("Timeout waiting for DHCP response")
294+
continue
295+
msg_type, xid = resp
292296
if msg_type == DHCP_OFFER:
293297
# use the _transaction_id the offer returned,
294298
# rather than the current one

0 commit comments

Comments
 (0)