Skip to content

dhcpd: skip empty disabled dhcpv4 config#8375

Open
0xnuminous wants to merge 1 commit into
AdguardTeam:masterfrom
0xnuminous:fix-disabled-dhcpv4-warning
Open

dhcpd: skip empty disabled dhcpv4 config#8375
0xnuminous wants to merge 1 commit into
AdguardTeam:masterfrom
0xnuminous:fix-disabled-dhcpv4-warning

Conversation

@0xnuminous

Copy link
Copy Markdown

Updates #8348.

When DHCPv4 is disabled and its address fields are empty, v4Create now returns an unconfigured disabled server without validating the empty IPv4 addresses.

Disabled but configured DHCPv4 settings still go through validation, so existing status output for saved disabled DHCPv4 ranges is preserved.

Tests:

  • go test ./internal/dhcpd
  • make go-check

Note: make go-check prints existing govulncheck findings for the pinned Go 1.26.2 standard library, but the target exits successfully.

@0xnuminous

Copy link
Copy Markdown
Author

One clarification after re-reading #8348 and the recent edge note: this PR is intentionally narrower than changing log level.

The edge build now logs the empty disabled DHCPv4 validation failure at debug level, but the reset/empty disabled config still causes v4Create to construct a validation error for address fields that are not meaningful while DHCPv4 is disabled. This patch skips that validation only when DHCPv4 is disabled and all IPv4 address fields are empty.

Disabled DHCPv4 configs that still contain saved address settings continue to go through the existing validation path, which preserves the current status behavior for configured-but-disabled DHCPv4 ranges.

Rechecked locally before marking ready:

  • go test ./internal/dhcpd
  • make go-check

make go-check exits successfully; it still prints the existing upstream govulncheck findings for the pinned Go 1.26.2 toolchain.

@0xnuminous 0xnuminous marked this pull request as ready for review May 11, 2026 11:21
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