mirror of
https://github.com/bettercap/bettercap
synced 2025-08-20 21:43:18 -07:00
Check for FlagUp when selecting iface
Fix iface selection on windows
This commit is contained in:
parent
409ba219dd
commit
94c0ac34f7
2 changed files with 8 additions and 6 deletions
3
.gitignore
vendored
3
.gitignore
vendored
|
@ -15,4 +15,5 @@ stage/
|
||||||
/snap
|
/snap
|
||||||
.idea
|
.idea
|
||||||
|
|
||||||
bettercap.exe
|
*.exe
|
||||||
|
.vscode/
|
|
@ -261,7 +261,7 @@ func FindInterface(name string) (*Endpoint, error) {
|
||||||
fmt.Printf("wtf of the day: %s", err)
|
fmt.Printf("wtf of the day: %s", err)
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
if iface.Flags&net.FlagUp != 0 {
|
||||||
for _, address := range addrs {
|
for _, address := range addrs {
|
||||||
ip := address.String()
|
ip := address.String()
|
||||||
if !strings.HasPrefix(ip, "127.0.0.1") && IPv4BlockValidator.MatchString(ip) {
|
if !strings.HasPrefix(ip, "127.0.0.1") && IPv4BlockValidator.MatchString(ip) {
|
||||||
|
@ -269,6 +269,7 @@ func FindInterface(name string) (*Endpoint, error) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return nil, ErrNoIfaces
|
return nil, ErrNoIfaces
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue