Skip to content
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

dhcp: always send parameter_request_list. #456

Merged
merged 2 commits into from
Apr 7, 2021
Merged

dhcp: always send parameter_request_list. #456

merged 2 commits into from
Apr 7, 2021

Conversation

Dirbaio
Copy link
Member

@Dirbaio Dirbaio commented Apr 1, 2021

Fixes #445.

Turns out the DHCP server wasn't sending the router/netmask/dns options due to us not requesting them on renews.

From reading the RFC it seems the server is allowed to not respond with parameters we don't ask. The solution is to ask for them.

Just asking for them on all DHCPREQUESTs seems to work, but I've seen all other DHCP clients request them in DHCPDISCOVERs too, so this is what I'm doing here.


Fixes a bug where the lease expiration is not cleared on reset.

If the DHCP server is gone and the lease expires, it would call reset(), which wouldn't clear the self.lease_expiration field. In next poll, lease_expired condition would match, immediatelly reset()ing again. This makes the client stuck in a reset loop.

@Dirbaio Dirbaio changed the title dhcp: always send parameter_request_list. Fixes #445. dhcp: always send parameter_request_list. Apr 1, 2021
@Dirbaio
Copy link
Member Author

Dirbaio commented Apr 1, 2021

@astro what are your thoughts on this? Is there some reason your implementation didn't send the reqlist on every packet?

@Dirbaio
Copy link
Member Author

Dirbaio commented Apr 1, 2021

Added fix for a bug where the lease expiration is not cleared on reset.

cc @ryan-summers

@ryan-summers
Copy link
Contributor

Added fix for a bug where the lease expiration is not cleared on reset.

cc @ryan-summers

This was intentional at the time, but the more I've thought about it the more I agree it should be reset as well. Thanks for including the fix

@Dirbaio Dirbaio enabled auto-merge April 7, 2021 00:32
@Dirbaio Dirbaio merged commit 32cf4be into master Apr 7, 2021
@Dirbaio Dirbaio deleted the dhcp-req-fix branch April 7, 2021 00:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

dhcp breaks when renew ACKs don't contain router and netmask
2 participants