Skip to content

Commit

Permalink
0 is a valid mask length
Browse files Browse the repository at this point in the history
  • Loading branch information
c-robinson committed Jan 18, 2024
1 parent e42b6ae commit 59bd9a5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions net.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,15 +81,15 @@ func AllNetsBetween(a, b net.IP) ([]Net, error) {
// will be false. If no fit can be found (probably because a >= b) an
// ErrNoValidRange will be returned
func NewNetBetween(a, b net.IP) (Net, bool, error) {
if CompareIPs(a, b) == 1 { // != -1 {
if CompareIPs(a, b) == 1 {
return nil, false, ErrNoValidRange
}

if EffectiveVersion(a) != EffectiveVersion(b) {
return nil, false, ErrNoValidRange
}

return fitNetworkBetween(a, b, 1)
return fitNetworkBetween(a, b, 0)
}

// ByNet implements sort.Interface for iplib.Net based on the
Expand Down

0 comments on commit 59bd9a5

Please sign in to comment.