Skip to content

DHCP: deconfigure even when state is NULL or NONE - #687

Open
rsmarples wants to merge 1 commit into
masterfrom
dhcp-deconf
Open

DHCP: deconfigure even when state is NULL or NONE#687
rsmarples wants to merge 1 commit into
masterfrom
dhcp-deconf

Conversation

@rsmarples

Copy link
Copy Markdown
Member

This makes the flow easier and only frees state when STOPPING which is the normal path and avoids a use after free if a NAK is recevied in this state.

This makes the flow easier and only frees state when STOPPING
which is the normal path and avoids a use after free if a NAK
is recevied in this state.
@coderabbitai

coderabbitai Bot commented Aug 3, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 8e964df1-5781-49f7-bffd-8809ecca20ab

📥 Commits

Reviewing files that changed from the base of the PR and between e3363cf and a466d33.

📒 Files selected for processing (1)
  • src/dhcp.c

Walkthrough

dhcp_deconfigure and dhcp_drop now route missing or inactive DHCP state through shared cleanup paths. These paths handle timeout removal, resource cleanup, option reset, and stop/close operations.

Changes

DHCP cleanup handling

Layer / File(s) Summary
Shared deconfiguration cleanup
src/dhcp.c
dhcp_deconfigure redirects missing or inactive state to shared option-reset and stop/close handling.
Drop cleanup routing
src/dhcp.c
dhcp_drop routes missing or inactive state through timeout removal and dhcp_deconfigure.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: DHCP deconfiguration now runs when the state is NULL or NONE.
Description check ✅ Passed The description explains the deconfiguration flow and the use-after-free risk addressed by the changes.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch dhcp-deconf

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.

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.

1 participant