-
Notifications
You must be signed in to change notification settings - Fork 35
DHCP state machine error handling #80
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…avoid problems with Pytest collecting tests. Began tests.
…one errors in send_dhcp_message.
…parse_dhcp_message and simplified MAGIC_COOKIE. Fixed router IP assignment to allow for multiple routers. Updated type hints.
…ecking server ID.
…ng 0, 0 when a problem occurs.
…hcp_message. Added pytest to optional_requirements.txt.
Thanks for working on this! I will check it out this evening. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tested this successfully on a Feather S2 TFT under both 7.3.3 and 8.0.0 beta5. Can confirm this fixes the issues mentioned in #75.
It's now able to reconnect successfully to my wired network. I'm guessing one of the off-by-1 errors that were fixed perhaps was the root cause of my transaction ID problem. Not certain, but either way it does appear to be solved, I have been able to successfully run the simpletest several times under both versions of circuitpython core.
That's good news. Thanks for testing this. The 'f' you were seeing with the error shows that the problem you had was a mismatched packet ID, probably from another device's DHCP request. If you run with |
# Conflicts: # adafruit_wiznet5k/adafruit_wiznet5k_dhcp.py
I merged main into this to resolve the current conflicts. Going to merge this PR. I re-tested the simpletest successfully with Feather TFT from the branch after merging main and resolving conflicts. For my ethernet environment the fixes in this PR seem to be required in order for me to successfully connect to the network. So merging this one will allow me to test out the other open PRs. |
Updating https://github.com/adafruit/Adafruit_CircuitPython_Wiznet5k to 1.13.1 from 1.13.0: > Merge pull request adafruit/Adafruit_CircuitPython_Wiznet5k#80 from BiffoBear/dhcp_error_handling Updating https://github.com/adafruit/Adafruit_CircuitPython_ImageLoad to 1.17.0 from 1.16.8: > Merge pull request adafruit/Adafruit_CircuitPython_ImageLoad#63 from FoamyGuy/png_typing_and_example > Add .venv to .gitignore > Update .pylintrc for v2.15.5 > Fix release CI files > Update pylint to 2.15.5 > Updated pylint version to 2.13.0 > Switching to composite actions Updating https://github.com/adafruit/Adafruit_CircuitPython_Motor to 3.4.6 from 3.4.5: > Merge pull request adafruit/Adafruit_CircuitPython_Motor#67 from tekktrik/pwmout-fix > Add .venv to .gitignore > Update .pylintrc for v2.15.5 > Fix release CI files > Update pylint to 2.15.5 > Updated pylint version to 2.13.0 > Switching to composite actions Updating https://github.com/adafruit/Adafruit_CircuitPython_Requests to 1.12.12 from 1.12.11: > Merge pull request adafruit/Adafruit_CircuitPython_Requests#124 from adafruit/chain-exception-when-fail > Add .venv to .gitignore Updating https://github.com/adafruit/Adafruit_CircuitPython_Bundle/circuitpython_library_list.md to NA from NA: > Updated download stats for the libraries
Closes #75 #79. @FoamyGuy Refactored
DHCP.parse_dhcp_response
to raiseValueError
instead of returning0, 0
. RefactoredDHCP._dhcp_state_machine
to catch the exception, print it if debugging is on, and continue.Fixed off-by-one bugs in
DHCP.send_dhcp_message
that caused the buffer to grow by 1 or 2 bytes every time the function is called.Fixed logic bugs in
DHCP.parse_dhcp_response
that meant that some errors were not being caught.Fixed a bug in
DHCP.parse_dhcp_response
where an IP address with more than 4 bytes would be returned if more than one router address was supplied by the DHCP server.