FIXED:
* Missing reservation checker
This commit is contained in:
brent saner
2025-04-04 14:29:07 -04:00
parent d37aa3eb6b
commit 32297d1bba
7 changed files with 208 additions and 8 deletions

View File

@@ -31,7 +31,7 @@ func (c *CIDRSplitter) Split() (nets []*netip.Prefix, remaining *netipx.IPSet, e
return
}
if c.PrefixLength > uint8(base.Bits()) {
if c.PrefixLength < uint8(base.Bits()) {
err = ErrBigPrefix
return
}
@@ -48,10 +48,10 @@ func (c *CIDRSplitter) Split() (nets []*netip.Prefix, remaining *netipx.IPSet, e
// We just hit the end of the prefix.
break
}
subPtr = new(netip.Prefix)
*subPtr = sub
nets = append(nets, subPtr)
}
subPtr = new(netip.Prefix)
*subPtr = sub
nets = append(nets, subPtr)
}
return