From 936b7012ba64da7bf4c52820f6de5b5e9dfc4405 Mon Sep 17 00:00:00 2001 From: Rusty Pen Date: Wed, 14 Apr 2021 17:57:17 +0800 Subject: [PATCH] Feature: PROCESS-NAME support freebsd 13, fix panic on unsupported platforms (#1351) --- component/process/process_freebsd_amd64.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/component/process/process_freebsd_amd64.go b/component/process/process_freebsd_amd64.go index 94f744da..bf84ce5b 100644 --- a/component/process/process_freebsd_amd64.go +++ b/component/process/process_freebsd_amd64.go @@ -30,6 +30,10 @@ func findProcessName(network string, ip net.IP, srcPort int) (string, error) { } }) + if defaultSearcher == nil { + return "", ErrPlatformNotSupport + } + var spath string isTCP := network == TCP switch network { @@ -190,6 +194,8 @@ func newSearcher(major int) *searcher { udpInpOffset: 8, } case 12: + fallthrough + case 13: s = &searcher{ headSize: 64, tcpItemSize: 744,