diff --git a/net/cidr/range.go b/net/cidr/range.go index 1d76987..3dbff65 100644 --- a/net/cidr/range.go +++ b/net/cidr/range.go @@ -6,12 +6,12 @@ import ( ) func NewCIDRRanger(cidr string) (CIDRRanger, error) { - nIP, nIPNet, err := net.ParseCIDR(cidr) + _, nIPNet, err := net.ParseCIDR(cidr) if nil != err { return nil, err } - switch len(nIP) { + switch len(nIPNet.IP) { case net.IPv4len: cr := &cidrRangeIPv4{ cidrNet: nIPNet,