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
network: several cleanups and fixes for DHCPv4 client #28508
Conversation
An -rc1 tag has been created and a release is being prepared, so please note that PRs introducing new features and APIs will be held back until the new version has been released. |
224a349
to
2462686
Compare
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 looked at the code… I can't say I could follow the details of route selection. But since there are tests that carefully check the result, I hope it's all OK. A few comments and naming and spelling and such.
I set |
It will be set in dhcp4_request_route_auto().
…) helper No functional changes, just refactoring and preparation for later commits.
Previously, we use the first router address, and if it is null, we ignore the address. Now, we use the first non-null address. That is, if the first router address is null, but the second is not, then we use the second one. That should not cause functional change in most cases, except for the case when a DHCP server provides such spurious reply. This is mostly for refactoring and preparation for later commits.
No functional change, just refactoring.
And if not found, refuse to configure the route. If a DHCP server provides classless static or static routes, then we should use the gateway for accessing a node in the range specified in the route. E.g. if a DHCP server provides the default gateway is 192.168.0.1, and classless static route for 8.0.0.0/8 with gateway 192.168.0.2, then we should access 8.8.8.8 through 192.168.0.2 rather than 192.168.0.1, but should use 192.168.0.1 for 9.9.9.9. Fixes systemd#28358.
Follow-up for 77451f6. Now, gateway for routes to DNS or NTP servers should be correctly picked, hence it is not necessary to adjust the gateway address in dhcp4_request_route_auto() again. Also, similar for classless static routes, let's always honor gateway address specified in (non-classless) static routes.
2462686
to
a56347d
Compare
@keszybz Thank you for the review.
PTAL. |
Fixes #28495.