Forgot some error checking.

This commit is contained in:
Antoine POPINEAU
2015-10-01 17:33:40 +02:00
parent 7fc3f83672
commit a70493f855

View File

@@ -154,7 +154,11 @@ func (f *NetworkFingerprint) nativeIpAddress(device string) (string, error) {
// TODO: should we handle IPv6 here? How do we determine precedence?
for _, i := range ifaces {
if i.Name == device {
addrs, _ := i.Addrs()
addrs, err := i.Addrs()
if err != nil {
return "", errors.New("could not retrieve interface IP addresses")
}
for _, a := range addrs {
switch v := a.(type) {
case *net.IPNet: