Add check to ensure matching PID constants

This commit is contained in:
Daniel
2022-06-22 09:56:47 +02:00
parent 9c0b7ddf51
commit bb782ba98f

View File

@@ -8,6 +8,7 @@ import (
"golang.org/x/sync/singleflight"
"github.com/safing/portbase/log"
"github.com/safing/portmaster/network/socket"
"github.com/safing/portmaster/profile"
)
@@ -28,6 +29,13 @@ const (
NetworkHostProcessID = -255
)
func init() {
// Check required matching values.
if UndefinedProcessID != socket.UndefinedProcessID {
panic("UndefinedProcessID does not match socket.UndefinedProcessID")
}
}
var (
// unidentifiedProcess is used for non-attributed outgoing connections.
unidentifiedProcess = &Process{