From 860f332c22fa2d039387f6e63bd63d15ad473a3c Mon Sep 17 00:00:00 2001 From: MashaSamoylova Date: Tue, 3 Nov 2020 18:33:58 +0700 Subject: [PATCH] Fix getting udp6 ports --- net/net_windows.go | 2 +- v3/net/net_windows.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/net/net_windows.go b/net/net_windows.go index 629fdfc7c..bdc928798 100644 --- a/net/net_windows.go +++ b/net/net_windows.go @@ -547,7 +547,7 @@ func getUDPConnections(family uint32) ([]ConnectionStat, error) { mibs := (*mibUDPRowOwnerPid)(unsafe.Pointer(&buf[index])) ns := mibs.convertToConnectionStat() stats = append(stats, ns) - case kindUDP4.family: + case kindUDP6.family: mibs := (*mibUDP6RowOwnerPid)(unsafe.Pointer(&buf[index])) ns := mibs.convertToConnectionStat() stats = append(stats, ns) diff --git a/v3/net/net_windows.go b/v3/net/net_windows.go index f43f50301..691d01914 100644 --- a/v3/net/net_windows.go +++ b/v3/net/net_windows.go @@ -547,7 +547,7 @@ func getUDPConnections(family uint32) ([]ConnectionStat, error) { mibs := (*mibUDPRowOwnerPid)(unsafe.Pointer(&buf[index])) ns := mibs.convertToConnectionStat() stats = append(stats, ns) - case kindUDP4.family: + case kindUDP6.family: mibs := (*mibUDP6RowOwnerPid)(unsafe.Pointer(&buf[index])) ns := mibs.convertToConnectionStat() stats = append(stats, ns)