Skip to content

Conversation

@rsmarples
Copy link
Member

As this will change periodically.
We only care if the state (address) has been added.

Fixes #440 thanks to JognSmit.

As this will change periodically.
We only care if the state (address) has been added.

Fixes #440 thanks to JognSmit.
@coderabbitai
Copy link

coderabbitai bot commented Nov 21, 2025

Walkthrough

Modified route handling in src/ipv4.c: the inet_dhcproutes guard now checks the STATE_ADDED bit in state->added, and routes are marked FAKE (RTDF_FAKE) when state->added includes the STATE_FAKE flag.

Changes

Cohort / File(s) Summary
IPv4 route handling
src/ipv4.c
Replaced guard state->state != DHS_BOUND && !state->added with !(state->added & STATE_ADDED) to base route processing on the STATE_ADDED bit. In the route loop, set RTDF_FAKE on routes when state->added has the STATE_FAKE flag.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

  • Inspect STATE_ADDED / STATE_FAKE flag definitions and usages to ensure consistent semantics.
  • Verify interactions with DHCP renew/rebind flows and multi-interface scenarios (linked issue #440 relevance).

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The PR title 'IPv4: Ignore DHCP state when building routes' accurately and concisely summarizes the main change - ignoring DHCP state changes when building routes to fix route deletion issues.
Description check ✅ Passed The PR description is related to the changeset, explaining that DHCP state changes periodically and only the address addition state matters, with a reference to fixing issue #440.
Linked Issues check ✅ Passed The code changes properly address issue #440 by preventing route deletion during DHCP renewals on other interfaces by checking only if STATE_ADDED is set rather than checking specific DHCP states that change periodically.
Out of Scope Changes check ✅ Passed All changes in src/ipv4.c are directly scoped to fixing the DHCP route handling issue - modifying inet_dhcproutes guard logic and route FAKE marking, with no extraneous modifications.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch dhcp-routes-added

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between d25c026 and 9bb6f5d.

📒 Files selected for processing (1)
  • src/ipv4.c (2 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/ipv4.c
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (14)
  • GitHub Check: netbsd (--disable-dhcp6, -DSMALL)
  • GitHub Check: netbsd (--disable-dhcp6)
  • GitHub Check: netbsd (--disable-arp)
  • GitHub Check: netbsd (--disable-ipv6, -DSMALL)
  • GitHub Check: netbsd (--disable-ipv6)
  • GitHub Check: netbsd (--disable-ipv4ll)
  • GitHub Check: netbsd (--disable-arp, -DSMALL)
  • GitHub Check: netbsd (--disable-ipv4ll, -DSMALL)
  • GitHub Check: netbsd (--disable-ipv4)
  • GitHub Check: netbsd (--disable-ipv4, -DSMALL)
  • GitHub Check: netbsd
  • GitHub Check: openbsd
  • GitHub Check: netbsd (-DSMALL)
  • GitHub Check: freebsd

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@perkelix
Copy link
Contributor

perkelix commented Dec 3, 2025

Does this seem ready to merge?

@rsmarples rsmarples merged commit 2de751b into master Dec 4, 2025
17 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.

Failure to renew with "ps_root_recvmsg: Network is unreachable"

3 participants