diff --git a/network/state/lookup.go b/network/state/lookup.go index 48d2f5b6..2202f2b9 100644 --- a/network/state/lookup.go +++ b/network/state/lookup.go @@ -107,7 +107,7 @@ func (table *tcpTable) lookup(pktInfo *packet.Info) ( } } - return socket.UnidentifiedProcessID, false, ErrConnectionNotFound + return socket.UnidentifiedProcessID, pktInfo.Inbound, ErrConnectionNotFound } func (table *udpTable) lookup(pktInfo *packet.Info) ( diff --git a/process/find.go b/process/find.go index 50070949..050b782b 100644 --- a/process/find.go +++ b/process/find.go @@ -2,7 +2,6 @@ package process import ( "context" - "errors" "github.com/safing/portmaster/network/state" @@ -10,11 +9,6 @@ import ( "github.com/safing/portmaster/network/packet" ) -// Errors -var ( - ErrProcessNotFound = errors.New("could not find process in system state tables") -) - // GetProcessByConnection returns the process that owns the described connection. func GetProcessByConnection(ctx context.Context, pktInfo *packet.Info) (process *Process, connInbound bool, err error) { if !enableProcessDetection() { @@ -27,7 +21,7 @@ func GetProcessByConnection(ctx context.Context, pktInfo *packet.Info) (process pid, connInbound, err = state.Lookup(pktInfo) if err != nil { log.Tracer(ctx).Debugf("process: failed to find PID of connection: %s", err) - return nil, connInbound, err + return nil, pktInfo.Inbound, err } process, err = GetOrFindPrimaryProcess(ctx, pid)