netutil: add dualstack to linux_route
in v3.1.0 netutil couldn't get default interface for ipv6only hosts Fixes #7219
This commit is contained in:
@ -19,9 +19,17 @@ package netutil
|
||||
import "testing"
|
||||
|
||||
func TestGetDefaultInterface(t *testing.T) {
|
||||
ifc, err := GetDefaultInterface()
|
||||
ifc, err := GetDefaultInterfaces()
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
t.Logf("default network interface: %q\n", ifc)
|
||||
t.Logf("default network interfaces: %+v\n", ifc)
|
||||
}
|
||||
|
||||
func TestGetDefaultHost(t *testing.T) {
|
||||
ip, err := GetDefaultHost()
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
t.Logf("default ip: %v", ip)
|
||||
}
|
||||
|
Reference in New Issue
Block a user