ing
This commit is contained in:
parent
8361ad5b53
commit
b88826a1cd
|
@ -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,
|
||||||
|
|
Loading…
Reference in New Issue
Block a user