Skip to content

DHCP: Don't run double EXPIRE hooks on carrier loss#589

Merged
rsmarples merged 1 commit intomasterfrom
dhcp_double_expire
Mar 19, 2026
Merged

DHCP: Don't run double EXPIRE hooks on carrier loss#589
rsmarples merged 1 commit intomasterfrom
dhcp_double_expire

Conversation

@rsmarples
Copy link
Member

Fixes #587.

@coderabbitai
Copy link

coderabbitai bot commented Mar 19, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 4ea61c9e-c374-44cf-be1e-1aa6de8270ca

📥 Commits

Reviewing files that changed from the base of the PR and between 42ff6d2 and 04cfae2.

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

Walkthrough

In dhcp_deconfigure(), the call to script_runreason(ifp, reason) was moved from an unconditional location to execute only within the non-DHCPCD_CONFIGURE branch, making script invocation conditional on the execution path.

Changes

Cohort / File(s) Summary
Script Execution Flow
src/dhcp.c
Moved script_runreason() invocation to execute only in the else branch of the DHCPCD_CONFIGURE condition, changing script execution from unconditional to conditional during DHCP deconfiguration.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ 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%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and specifically describes the main change: preventing double EXPIRE hook execution on carrier loss, which directly addresses the issue being fixed.
Description check ✅ Passed The description references issue #587, which is directly related to the changeset addressing double EXPIRE hook execution.
Linked Issues check ✅ Passed The code change prevents the second EXPIRE hook execution by moving script_runreason() to execute only conditionally, which directly fixes the double EXPIRE problem reported in issue #587.
Out of Scope Changes check ✅ Passed All changes in dhcp.c are directly related to fixing the double EXPIRE hook execution issue; no out-of-scope modifications are present.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ 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_double_expire
📝 Coding Plan
  • Generate coding plan for human review comments

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.

Tip

CodeRabbit can generate a title for your PR based on the changes with custom instructions.

Set the reviews.auto_title_instructions setting to generate a title for your PR based on the changes in the PR with custom instructions.

@rsmarples rsmarples merged commit 629773b into master Mar 19, 2026
3 of 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.

dhcpcd refuses to stop if interface link is down

1 participant