From fd331bda3f4bbc9aad07ccd4bd2abaa1e363a852 Mon Sep 17 00:00:00 2001 From: Neil Alexander Date: Thu, 25 Jul 2019 08:32:26 +0100 Subject: [PATCH] Windows: don't trip over empty HardwareAddr when enumerating interfaces (this happens sometimes when miniport/VPN adapters are active on the system) --- syscalls_windows.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/syscalls_windows.go b/syscalls_windows.go index a3b50a5..f38a9cb 100644 --- a/syscalls_windows.go +++ b/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