Fix IP address parsing bug

pull/16/head
brl 9 years ago
parent 27391175f7
commit 35f3735a40

@ -139,10 +139,10 @@ func (r *Rule) parseAddr(a string) bool {
return true
}
ip := net.ParseIP(a)
if ip == nil || len(ip) != 4 {
if ip == nil {
return false
}
r.addr = binary.BigEndian.Uint32(ip)
r.addr = binary.BigEndian.Uint32(ip.To4())
return true
}

Loading…
Cancel
Save