Skip to content

Commit

Permalink
Windows: don't trip over empty HardwareAddr when enumerating interfac…
Browse files Browse the repository at this point in the history
…es (this happens sometimes when miniport/VPN adapters are active on the system)
  • Loading branch information
neilalexander authored and songgao committed Jul 25, 2019
1 parent acc9cc2 commit fd331bd
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions syscalls_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit fd331bd

Please sign in to comment.