Feature: remove pre resolve process name

This commit is contained in:
yaling888
2022-06-23 15:13:32 +08:00
parent 7731a684b1
commit b9ee4b902f
2 changed files with 24 additions and 15 deletions

View File

@@ -28,6 +28,9 @@ func ShouldFindProcess(metadata *C.Metadata) bool {
if metadata.Process != "" {
return false
}
if metadata.SrcIP.IsUnspecified() {
return true
}
for _, ip := range localIPs {
if ip == metadata.SrcIP {
return true
@@ -41,7 +44,7 @@ func AppendLocalIPs(ip ...netip.Addr) {
}
func getLocalIPs() []netip.Addr {
ips := []netip.Addr{netip.IPv4Unspecified(), netip.IPv6Unspecified()}
var ips []netip.Addr
netInterfaces, err := net.Interfaces()
if err != nil {