fixed a bug which caused a cidr being parsed as an ip and eventually a panic (fixes #241)

This commit is contained in:
evilsocket 2018-04-26 19:33:05 +02:00
commit ae0afc54b5
No known key found for this signature in database
GPG key ID: 1564D7F30393A456
2 changed files with 2 additions and 2 deletions

View file

@ -133,7 +133,7 @@ func buildEndpointFromInterface(iface net.Interface) (*Endpoint, error) {
for _, a := range addrs {
address := a.String()
if IPv4Validator.MatchString(address) {
if strings.ContainsRune(address, '/') {
if !strings.ContainsRune(address, '/') {
// plain ip
e.SetIP(address)
} else {