This commit is contained in:
ston1th 2020-11-15 00:43:34 +01:00
commit 41027fa380
5 changed files with 9 additions and 11 deletions

View file

@ -14,10 +14,9 @@ func DefaultInterface() (iface string, err error) {
return
}
if len(routes) >= 1 {
link, e := netlink.LinkByIndex(routes[0].LinkIndex)
if e != nil {
err = e
return
link, err := netlink.LinkByIndex(routes[0].LinkIndex)
if err != nil {
return "", err
}
return link.Attrs().Name, nil
}