Open
Conversation
Contributor
There was a problem hiding this comment.
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_ackthat 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
previously approved these changes
Feb 23, 2026
a967388 to
50606a1
Compare
d76e193 to
161baf9
Compare
Attempt to improve test stability
Attempt to stabilize CI tests
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
fenrir / C-2
fernir security / C-1