-
Notifications
You must be signed in to change notification settings - Fork 7k
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
net/ip/dhcpv4: Set source IP address for DHCP renewal requests #15179
Conversation
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.
small issues
The source address in unicast DHCPv4 Request packets was found out to be all zeros address 0.0.0.0. This address is only acceptable if the destination is a multicast one, where the host in question is acquiring a DHCP address lease. This is true for the DHCP Discover and the initial DHCP Request message from the client towards the server. As subsequent DHCP Request renewal messages are sent as unicast to the server, the server will drop such packets. Fix this issue by explicitely specifying what source IP address is to be used, if none is specified, the all zeros address 0.0.0.0 is used in multicast addresses. The source address in the other unicast cases is identical to the 'ciaddr' in the DHCP message. Signed-off-by: Patrik Flykt <[email protected]>
To clarify: Linux user space never sees the DHCP Request messages sent with source address 0.0.0.0. It will eventually work, as the Zephyr DHCP client restarts the address acquisition procedure with a DHCP Discover, but depending on the situation and DHCP servers involved, Zephyr might loose its address in between or get a new one assigned due to restarting of the DHCP procedure. |
It would probably be a good idea to get this merged, I'd guess users would need this fix in the LTS anyway later. |
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.
This looks like a clean fix, and probably would (severely) affect production, long-running devices. @pfl, Please post a bug describing that case, and add "Fixes: " header to commit, to satisfy conditions for its inclusion in the release.
Bug is #16012 |
The source address in unicast DHCPv4 Request packets was found out
to be all zeros address 0.0.0.0. This address is only acceptable if
the destination is a multicast one, where the host in question is
acquiring a DHCP address lease. This is true for the DHCP Discover
and the initial DHCP Request message from the client towards the
server. As subsequent DHCP Request renewal messages are sent as
unicast to the server, the server will drop such packets.
Fix this issue by explicitely specifying what source IP address is
to be used, if none is specified, the all zeros address 0.0.0.0 is
used in multicast addresses. The source address in the other
unicast cases is identical to the 'ciaddr' in the DHCP message.
Signed-off-by: Patrik Flykt [email protected]