-
Notifications
You must be signed in to change notification settings - Fork 20
Open
Description
/32 networks (single host) get weird output from some of the calls. Admittedly some of the function calls don't necessarily make sense for /32, but the output doesn't seem to be what one would expect:
sub := ipsubnet.SubnetCalculator("8.8.8.8", "32")
sub.GetNumberIPAddresses() // 0
sub.GetNumberAddressableHosts() // 1
sub.GetIPAddressRange()[0] // 8.8.8.8
sub.GetIPAddressRange()[1] // 263.263.263.263
sub.GetBroadcastAddress() // 263.263.263.263
GetNumberIPAddresses
: I would think this would return 1 since /32 generally means just a single IP address, though I can see how 0 might result from masking operations.GetNumberAddressableHosts
: I'm not sure if this should return 1 or 0, but 1 is probably preferred and is what is currently returnedGetIPAddressRange()[1]
: This should just return the single IP address. The return value isn't validGetBroadcastAddress()
: I would think this would just return the single IP address as well. The return value isn't valid.
Metadata
Metadata
Assignees
Labels
No labels