mirror of
https://github.com/fumiama/water.git
synced 2026-06-05 02:00:29 +08:00
Windows: don't trip over empty HardwareAddr when enumerating interfaces (this happens sometimes when miniport/VPN adapters are active on the system)
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user