Kaynağa Gözat

Windows: don't trip over empty HardwareAddr when enumerating interfaces (this happens sometimes when miniport/VPN adapters are active on the system)

Neil Alexander 6 yıl önce
ebeveyn
işleme
fd331bda3f
1 değiştirilmiş dosya ile 3 ekleme ve 0 silme
  1. 3 0
      syscalls_windows.go

+ 3 - 0
syscalls_windows.go

@@ -300,6 +300,9 @@ func openDev(config Config) (ifce *Interface, err error) {
 	}
 
 	for _, v := range ifces {
+		if len(v.HardwareAddr) < 6 {
+			continue
+		}
 		if bytes.Equal(v.HardwareAddr[:6], mac[:6]) {
 			ifce.name = v.Name
 			return