Skip to content

Fix DHCP ACK parsing#41

Merged
LinuxJedi merged 9 commits intowolfSSL:masterfrom
danielinux:fix-dhcp-reuse-stale-option-data
Feb 24, 2026
Merged

Fix DHCP ACK parsing#41
LinuxJedi merged 9 commits intowolfSSL:masterfrom
danielinux:fix-dhcp-reuse-stale-option-data

Conversation

@danielinux
Copy link
Copy Markdown
Member

@danielinux danielinux commented Feb 23, 2026

  • fenrir / C-2

  • fernir security / C-1

Copy link
Copy Markdown
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

This PR fixes a critical bug in DHCP ACK message parsing where a reused variable caused all DHCP options to use the value from the first option, resulting in incorrect network configuration. The fix moves the variable declaration inside the parsing loop, and the test is enhanced to verify all DHCP options are parsed correctly with distinct values.

Changes:

  • Fixed variable scoping bug in dhcp_parse_ack that caused all DHCP options to reuse the first option's value
  • Enhanced test coverage to verify IP address, netmask, gateway, and DNS are all parsed correctly with distinct values

Reviewed changes

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

File Description
src/wolfip.c Moved data variable declaration inside the option parsing loop to ensure each DHCP option is parsed with its own value instead of reusing the first option's value
src/test/unit/unit.c Added separate test variables for router and DNS IPs, added DHCP_OPTION_ROUTER and DHCP_OPTION_OFFER_IP to test message, and added assertions to verify all configuration fields are set correctly

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

LinuxJedi
LinuxJedi previously approved these changes Feb 23, 2026
@danielinux danielinux force-pushed the fix-dhcp-reuse-stale-option-data branch from a967388 to 50606a1 Compare February 23, 2026 12:15
@danielinux danielinux force-pushed the fix-dhcp-reuse-stale-option-data branch from d76e193 to 161baf9 Compare February 23, 2026 14:02
Copilot AI review requested due to automatic review settings February 24, 2026 06:09
@danielinux danielinux force-pushed the fix-dhcp-reuse-stale-option-data branch from 7a36b1d to 1c1403b Compare February 24, 2026 06:09
Copy link
Copy Markdown
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 3 out of 3 changed files in this pull request and generated 5 comments.


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

Comment thread src/wolfip.c
Comment thread src/wolfip.c Outdated
Comment thread src/wolfip.c Outdated
Comment thread src/wolfip.c
Comment thread src/test/unit/unit.c
Copilot AI review requested due to automatic review settings February 24, 2026 06:48
Copy link
Copy Markdown
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 3 out of 3 changed files in this pull request and generated 1 comment.


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

Comment thread src/test/unit/unit.c
@LinuxJedi LinuxJedi merged commit 67e8269 into wolfSSL:master Feb 24, 2026
5 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.

4 participants