-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
networkd: fallback to chaddr for static lease lookup when not found #27313
Conversation
This is my first PR, and I'm a C noob, so please bear with me :) Some remarks:
|
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.
Thank you! The basic logic sounds good to me. Several minor requests.
Thanks for the review @yuwata, despite my apparent failure to run the tests locally and all failing. I will try to fix your remarks in today or in the next couple of days. Could you confirm that the CI error is due to a missing
So the "buffer-overflow-2", "discover-existing", .... Are these tests? Or like data sets and |
a1ee54b
to
a89a5d5
Compare
At the moment (some) of the builds passed. So I think this was corrent. Fixed by extracting a variabele for the data and using
I think these are based on files in |
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.
Looks mostly OK. Several minor comments.
a89a5d5
to
2d498bb
Compare
@RobertMe I cannot see the revised commit. Maybe you pushed an older version? |
DHCP static leases are looked up by the client identifier as send by the client, while configured based on MAC. As RFC 2131 states the client identifier is an opaque key and must not be interpreted by the server this means that DHCP clients can (/will) also use a client identifier which is not a MAC address. One of these clients actually is systemd-networkd which uses an RFC 4361 by default to generate the client identifier. For these kind of DHCP clients static leases thus don't work because of this mismatch between configuring a MAC address but the server matching based on client identifier. This adds a fallback to try to look up a configured static lease based on the "chaddr" of the DHCP message as this will always contain the MAC address of the client. Fixes systemd#21368
2d498bb
to
aaf137a
Compare
@yuwata whoops, that was stupid. Did a |
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.
LGTM. Thank you!
@yuwata we had a downstream bug report against v252 in Debian: Do you think it would be feasible/reasonable to backport this patch to v252-stable? |
Yeah, not sure we can cleanly backport it (that is, |
That would be awesome. As I actually discovered this issue while running Debian (Bookworm) myself. So if it could be backported I don't have to wait ~2 years to actually use my own bugfix 😃 And if I can be of any help please let me know. |
|
DHCP static leases are looked up by the client identifier as send by the client, while configured based on MAC. As RFC 2131 states the client identifier is an opaque key and must not be interpreted by the server this means that DHCP clients can (/will) also use a client identifier which is not a MAC address. One of these clients actually is systemd-networkd which uses an RFC 4361 by default to generate the client identifier. For these kind of DHCP clients static leases thus don't work because of this mismatch between configuring a MAC address but the server matching based on client identifier. This adds a fallback to try to look up a configured static lease based on the "chaddr" of the DHCP message as this will always contain the MAC address of the client.
Fixes #21368