Problem
The Assert-ScopeParameter function in source/Modules/DhcpServerDsc.Common/Public/Assert-ScopeParameter.ps1 currently accepts both 'IPv4' and 'IPv6' in its AddressFamily parameter ValidateSet, but the implementation only supports IPv4 validation.
The function logic uses IPv4-specific assumptions:
- Loops through 4 bytes (0..3) for address validation
- Uses IPv4-style subnet mask format and validation
- Would fail or produce incorrect results when IPv6 parameters are provided
Options to resolve
Option A (immediate): Restrict ValidateSet to only 'IPv4' to match current implementation
Option B (future): Implement full IPv6 support with 16-byte address handling, prefix length notation, and appropriate validation logic
References
Problem
The
Assert-ScopeParameterfunction insource/Modules/DhcpServerDsc.Common/Public/Assert-ScopeParameter.ps1currently accepts both 'IPv4' and 'IPv6' in its AddressFamily parameter ValidateSet, but the implementation only supports IPv4 validation.The function logic uses IPv4-specific assumptions:
Options to resolve
Option A (immediate): Restrict ValidateSet to only 'IPv4' to match current implementation
Option B (future): Implement full IPv6 support with 16-byte address handling, prefix length notation, and appropriate validation logic
References