fixed net.FindGateway if there's a VPN interface active

This commit is contained in:
evilsocket 2018-05-03 13:03:52 +02:00
commit 5041267be9
No known key found for this signature in database
GPG key ID: 1564D7F30393A456
3 changed files with 18 additions and 56 deletions

View file

@ -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) {