Browse Source

Merge pull request #25 from YungSang/topic

Fix GetInterfaceByIP()
Jonathan Boulle 10 years ago
parent
commit
78e6ed535e
1 changed files with 1 additions and 1 deletions
  1. 1 1
      pkg/ip/iface.go

+ 1 - 1
pkg/ip/iface.go

@@ -51,7 +51,7 @@ func GetInterfaceByIP(ip net.IP) (*net.Interface, error) {
 
 	for _, iface := range ifaces {
 		addr, err := GetIfaceIP4Addr(&iface)
-		if err != nil && ip.Equal(addr) {
+		if err == nil && ip.Equal(addr) {
 			return &iface, nil
 		}
 	}