Skip to content

Fix endianness of default DHCP offer netmask#56

Merged
philljj merged 4 commits intowolfSSL:masterfrom
danielinux:dhcp-default-netmask
Mar 2, 2026
Merged

Fix endianness of default DHCP offer netmask#56
philljj merged 4 commits intowolfSSL:masterfrom
danielinux:dhcp-default-netmask

Conversation

@danielinux
Copy link
Member

When no netmask is offered and we are using the default 24bit netmask, ensure it's set with the right endianness.

Found by fenrir/141

Copilot AI review requested due to automatic review settings March 2, 2026 15:02
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Fixes the byte-order of the default subnet mask applied during DHCP OFFER parsing when the server does not provide an explicit subnet mask option, ensuring the internal ipconf.mask is set correctly (e.g., /24 becomes 255.255.255.0).

Changes:

  • Correct the default DHCP OFFER netmask constant so it is converted into the proper internal (host-order) mask value.
  • Add a unit test covering the “missing subnet mask option” DHCP OFFER path.
  • Register the new unit test in the test suite.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
src/wolfip.c Adjusts the default DHCP OFFER netmask initialization to match the parser’s endianness conversion behavior.
src/test/unit/unit.c Adds and registers a regression test asserting the default /24 mask is applied when no mask option is present.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@philljj philljj self-assigned this Mar 2, 2026
@danielinux danielinux requested review from Copilot and philljj March 2, 2026 22:07
@danielinux danielinux force-pushed the dhcp-default-netmask branch from 371a37d to 03ba436 Compare March 2, 2026 22:08
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 5 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@philljj philljj merged commit 2881b53 into wolfSSL:master Mar 2, 2026
15 checks passed
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.

3 participants