Repository navigation
IPNetwork.GetPrefixLengthForSubnets now gives an answer for an empty list instead of throwing, like the other sizing methods do for zero. Nothing else changes, so code written for 1.1.0 builds unchanged.
dotnet add package Bitvantage.InternetProtocol.IPNetworkExtensions --version 1.1.1Changed
IPNetwork.GetPrefixLengthForSubnetsgives a host network, /32 or /128, for an empty list of prefix lengths, where 1.1.0 threw anArgumentException. That matchesGetPrefixLengthForAddressesandGetPrefixLengthForHosts, which give a host network for zero, and the host network holds the empty plan, whichAllocateSubnetsaccepts. A plan built from a list that filters down to nothing now flows through sizing and allocation without a special case.
IPNetwork.GetPrefixLengthForSubnets(IPVersion.IPv4, []); // 32
IPNetwork.GetPrefixLengthForSubnets(IPVersion.IPv6, []); // 128See the changelog for more.