DHCPv4 configuration cannot be saved when an IPv6-capable interface has no DHCPv6 range configured

Author: aschyolkinCreated Sep 16, 2026Updated Sep 17, 2026
LabelsbugPriority: P4

Version and test environment

master at aad2e15ffc403993f60c9c9cba2ef8dd85e18479. Source checkout; isolated frontend reproduction with Node.js 18.19.1. These results come from the actual source components/validators, not an end-to-end test against a running AdGuard Home installation. No production DHCP configuration was changed.

Summary

The IPv4 and IPv6 DHCP forms share a single React Hook Form instance. When the selected interface has an IPv6 address, the IPv6 range start is required even if the user only wants to configure DHCPv4. Submitting the IPv4 form therefore fails validation on an unrelated IPv6 field.

Steps to reproduce

  1. Select an interface with both IPv4 and IPv6 addresses, for example 192.168.1.1 and fe80::1.
  2. Enter valid DHCPv4 settings: gateway 192.168.1.1, subnet mask 255.255.255.0, range 192.168.1.100192.168.1.200, lease duration 86400.
  3. Leave DHCPv6 range_start empty (DHCPv6 is not wanted). Its lease duration can remain 86400.
  4. Submit the IPv4 configuration.

Expected result

Valid DHCPv4 settings can be saved without requiring DHCPv6 configuration merely because the interface has an IPv6 address.

Actual result and verification

Mounted the original FormDHCPv4 and FormDHCPv6 components under a shared FormProvider, matching their parent component. Used React 16.14.0, react-test-renderer 16.14.0 and react-hook-form 7.54.2; translations and styling were isolated. Invoked the IPv4 form's actual submit handler.

Interface IPv6 addresses: ["fe80::1"]
Submit callback called: false
Validation error: v6.range_start = form_error_required

Control case, IPv6 addresses absent, otherwise identical values:
Submit callback called: true
Validation errors: none

Cause / possible fix

FormDHCPv6.tsx makes v6.range_start required based only on interface IPv6 availability. Both forms use the shared form context established in Dhcp/index.tsx.

Allow an unconfigured DHCPv6 section when saving IPv4 settings, or scope validation to the section being submitted. Add a regression test for IPv4-only DHCP configuration on a dual-stack interface.

Related reports checked

#8075 concerns a backend panic during saving; #8164 concerns enabling DHCP/checking for existing DHCP servers. This reproduction fails in frontend validation before the submit callback runs.