Remove unmanaged check; nothing else will own these interfaces
This commit is contained in:
@@ -2,7 +2,6 @@ package main
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"net"
|
|
||||||
"os"
|
"os"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"strings"
|
"strings"
|
||||||
@@ -272,35 +271,6 @@ func checkRings(fd int, ifname string, rxWant, txWant uint32) (checkResult, bool
|
|||||||
return res, true
|
return res, true
|
||||||
}
|
}
|
||||||
|
|
||||||
func checkNoAddrs(ifname string) checkResult {
|
|
||||||
res := checkResult{item: ifname + " unmanaged"}
|
|
||||||
ifi, err := net.InterfaceByName(ifname)
|
|
||||||
if err != nil {
|
|
||||||
res.err = err
|
|
||||||
return res
|
|
||||||
}
|
|
||||||
addrs, err := ifi.Addrs()
|
|
||||||
if err != nil {
|
|
||||||
res.err = err
|
|
||||||
return res
|
|
||||||
}
|
|
||||||
var routable []string
|
|
||||||
for _, a := range addrs {
|
|
||||||
ipn, ok := a.(*net.IPNet)
|
|
||||||
if !ok || ipn.IP.IsLinkLocalUnicast() {
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
routable = append(routable, a.String())
|
|
||||||
}
|
|
||||||
if len(routable) == 0 {
|
|
||||||
res.state = "no routable addresses"
|
|
||||||
return res
|
|
||||||
}
|
|
||||||
res.err = fmt.Errorf("has %s; NetworkManager or DHCP is configuring this interface",
|
|
||||||
strings.Join(routable, ","))
|
|
||||||
return res
|
|
||||||
}
|
|
||||||
|
|
||||||
func withIoctlSocket(fn func(fd int) []checkResult) []checkResult {
|
func withIoctlSocket(fn func(fd int) []checkResult) []checkResult {
|
||||||
fd, err := unix.Socket(unix.AF_INET, unix.SOCK_DGRAM, 0)
|
fd, err := unix.Socket(unix.AF_INET, unix.SOCK_DGRAM, 0)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@@ -324,7 +294,6 @@ func configureSystem(ifnames []string) []checkResult {
|
|||||||
carrierWait = 10 * time.Second
|
carrierWait = 10 * time.Second
|
||||||
}
|
}
|
||||||
out = append(out, checkCarrier(ifname, carrierWait))
|
out = append(out, checkCarrier(ifname, carrierWait))
|
||||||
out = append(out, checkNoAddrs(ifname))
|
|
||||||
}
|
}
|
||||||
return out
|
return out
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user