mirror of
https://github.com/bettercap/bettercap
synced 2025-08-21 05:53:20 -07:00
Revert "fix: adopt new IPv4 parsing logic"
This reverts commit 44a17602ed
.
This commit is contained in:
parent
e224eea8c6
commit
21692be61f
1 changed files with 10 additions and 9 deletions
|
@ -196,16 +196,17 @@ func buildEndpointFromInterface(iface net.Interface) (*Endpoint, error) {
|
||||||
|
|
||||||
for _, a := range addrs {
|
for _, a := range addrs {
|
||||||
address := a.String()
|
address := a.String()
|
||||||
switch true {
|
if IPv4Validator.MatchString(address) {
|
||||||
case IPv4Validator.MatchString(address):
|
if !strings.ContainsRune(address, '/') {
|
||||||
e.SetIP(address)
|
// plain ip
|
||||||
break
|
e.SetIP(address)
|
||||||
case IPv4BlockValidator.MatchString(address):
|
} else {
|
||||||
e.SetNetwork(address)
|
// ip/bits
|
||||||
break
|
e.SetNetwork(address)
|
||||||
default:
|
}
|
||||||
|
} else {
|
||||||
|
// ipv6/xxx
|
||||||
e.SetIPv6(address)
|
e.SetIPv6(address)
|
||||||
break
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue