Skip to content

IPv6 validation not implemented in Assert-ScopeParameter function #103

@coderabbitai

Description

@coderabbitai

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementThe issue is an enhancement request.help wantedThe issue is up for grabs for anyone in the community.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions