mirror of
https://github.com/bettercap/bettercap
synced 2025-08-14 02:36:57 -07:00
fixed net.FindGateway if there's a VPN interface active
This commit is contained in:
parent
407fd392b9
commit
5041267be9
3 changed files with 18 additions and 56 deletions
|
@ -1,7 +1,6 @@
|
|||
package network
|
||||
|
||||
import (
|
||||
"net"
|
||||
"testing"
|
||||
)
|
||||
|
||||
|
@ -14,16 +13,8 @@ func buildExampleLAN() *LAN {
|
|||
}
|
||||
|
||||
func buildExampleEndpoint() *Endpoint {
|
||||
ifaces, _ := net.Interfaces()
|
||||
var exampleIface net.Interface
|
||||
for _, iface := range ifaces {
|
||||
if iface.HardwareAddr != nil {
|
||||
exampleIface = iface
|
||||
break
|
||||
}
|
||||
}
|
||||
foundEndpoint, _ := FindInterface(exampleIface.Name)
|
||||
return foundEndpoint
|
||||
iface, _ := FindInterface("")
|
||||
return iface
|
||||
}
|
||||
|
||||
func TestNewLAN(t *testing.T) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue