This commit is contained in:
crusader 2017-11-17 19:34:21 +09:00
parent 8361ad5b53
commit b88826a1cd

View File

@ -6,12 +6,12 @@ import (
) )
func NewCIDRRanger(cidr string) (CIDRRanger, error) { func NewCIDRRanger(cidr string) (CIDRRanger, error) {
nIP, nIPNet, err := net.ParseCIDR(cidr) _, nIPNet, err := net.ParseCIDR(cidr)
if nil != err { if nil != err {
return nil, err return nil, err
} }
switch len(nIP) { switch len(nIPNet.IP) {
case net.IPv4len: case net.IPv4len:
cr := &cidrRangeIPv4{ cr := &cidrRangeIPv4{
cidrNet: nIPNet, cidrNet: nIPNet,