diff --git a/component/process/process_darwin.go b/component/process/process_darwin.go index 3c2007fd..5615b985 100644 --- a/component/process/process_darwin.go +++ b/component/process/process_darwin.go @@ -15,6 +15,10 @@ const ( proccallnumpidinfo = 0x2 ) +func resolveSocketByNetlink(network string, ip netip.Addr, srcPort int) (int32, int32, error) { + return 0, 0, ErrPlatformNotSupport +} + func findProcessName(network string, ip netip.Addr, port int) (int32, string, error) { var spath string switch network { @@ -78,7 +82,8 @@ func findProcessName(network string, ip netip.Addr, port int) (int32, string, er if ip == srcIP { // xsocket_n.so_last_pid pid := readNativeUint32(buf[so+68 : so+72]) - return getExecPathFromPID(pid) + pp, err := getExecPathFromPID(pid) + return -1, pp, err } // udp packet connection may be not equal with srcIP @@ -88,10 +93,10 @@ func findProcessName(network string, ip netip.Addr, port int) (int32, string, er } if network == UDP && fallbackUDPProcess != "" { - return fallbackUDPProcess, nil + return -1, fallbackUDPProcess, nil } - return "", ErrNotFound + return -1, "", ErrNotFound } func getExecPathFromPID(pid uint32) (string, error) {