Skip to content

Backport BOOTP from systemd/main (v257-8) to debian/systemd v252 Bookworm .deb #1

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

Open
wants to merge 5 commits into
base: agd-debian/252.31-1_deb12u1-base
Choose a base branch
from

Conversation

avramd
Copy link
Collaborator

@avramd avramd commented Jan 20, 2025

Note, sd-dhcp-client.c is really a wholesale reimplementation of the original, not simply a merge or an automated patch. This was necessary because the code in that file had been heavily refactored between systemd v252 and v257.

This update is not necessarily final, since the feature has not yet been merged to systemd/main.

@avramd avramd requested a review from thom-nic January 20, 2025 00:08
@@ -883,7 +906,7 @@ static int client_message_init(
*/
/* RFC7844 section 3:
SHOULD NOT contain any other option. */
if (!client->anonymize && IN_SET(type, DHCP_DISCOVER, DHCP_REQUEST)) {
if (!client->bootp && !client->anonymize && IN_SET(type, DHCP_DISCOVER, DHCP_REQUEST)) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a style choice but it looks like this block and the one on 861 could all be inside the if block on 814? Alternately you could add !client->bootp to the if blocks on lines on 819 and 838 - that would not be my first choice unless your goal is to minimize the diff.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like you are right, nice catch. It wasn't always like that, there was a big refactor towards the end after I discovered that my initial attempt at keeping things simple... wasn't.

I'll give this a try. There's a part of me that's loathe to go back to that stage, rebuild, and then do significant verification. But logically it kinda seems like it's pretty straight forward that the logic is identical and short of seeing it compile I don't really need to retest anything.

Comment on lines 1082 to 1083
if (client->bootp)
if (optoffset < 60 && optlen >= 60) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

condense this down to a single if?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants