mirror of
https://github.com/bettercap/bettercap
synced 2025-08-21 05:53:20 -07:00
fix: search interface by name or ip.
This commit is contained in:
parent
bdb4d63c80
commit
513595744c
1 changed files with 10 additions and 0 deletions
10
net/net.go
10
net/net.go
|
@ -57,6 +57,16 @@ func FindInterface(name string) (*Endpoint, error) {
|
|||
doCheck = true
|
||||
}
|
||||
|
||||
// Also search by ip if needed.
|
||||
if name != "" {
|
||||
for _, a := range addrs {
|
||||
if a.String() == name {
|
||||
doCheck = true
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if doCheck {
|
||||
var e *Endpoint = nil
|
||||
// interface is in monitor mode (or it's just down and the user is dumb)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue