diff --git a/common/fakeip/pool.go b/common/fakeip/pool.go index 430b0c6..1427e80 100755 --- a/common/fakeip/pool.go +++ b/common/fakeip/pool.go @@ -86,15 +86,11 @@ func uintToIP(v uint32) net.IP { } // New return Pool instance -func New(ipnet *net.IPNet, offset, size int) (*Pool, error) { - if offset < 2 { - return nil, errors.New("offset must not less than 2") - } - - min := ipToUint(ipnet.IP) + uint32(offset) +func New(ipnet *net.IPNet, size int) (*Pool, error) { + min := ipToUint(ipnet.IP) + 2 ones, bits := ipnet.Mask.Size() - total := 1<