Fix linter errors

This commit is contained in:
Daniel 2023-12-01 13:19:03 +01:00
parent cf508dcd34
commit c2da5268b9
3 changed files with 4 additions and 36 deletions

View file

@ -143,22 +143,6 @@ var (
// Setting "DNS Exit Node Rules" at order 148. // Setting "DNS Exit Node Rules" at order 148.
) )
// A list of all security level settings.
var securityLevelSettings = []string{
CfgOptionBlockScopeInternetKey,
CfgOptionBlockScopeLANKey,
CfgOptionBlockScopeLocalKey,
CfgOptionBlockP2PKey,
CfgOptionBlockInboundKey,
CfgOptionFilterSubDomainsKey,
CfgOptionFilterCNAMEKey,
CfgOptionRemoveOutOfScopeDNSKey,
CfgOptionRemoveBlockedDNSKey,
CfgOptionDomainHeuristicsKey,
CfgOptionPreventBypassingKey,
CfgOptionDisableAutoPermitKey,
}
var ( var (
// SPNRulesQuickSettings are now generated automatically shorty after start. // SPNRulesQuickSettings are now generated automatically shorty after start.
SPNRulesQuickSettings = []config.QuickSetting{ SPNRulesQuickSettings = []config.QuickSetting{

View file

@ -11,7 +11,6 @@ import (
"github.com/safing/portbase/runtime" "github.com/safing/portbase/runtime"
"github.com/safing/portmaster/intel" "github.com/safing/portmaster/intel"
"github.com/safing/portmaster/profile/endpoints" "github.com/safing/portmaster/profile/endpoints"
"github.com/safing/portmaster/status"
) )
// LayeredProfile combines multiple Profiles. // LayeredProfile combines multiple Profiles.
@ -444,14 +443,6 @@ func (lp *LayeredProfile) MatchFilterLists(ctx context.Context, entity *intel.En
return endpoints.NoMatch, nil return endpoints.NoMatch, nil
} }
func (lp *LayeredProfile) wrapSecurityLevelOption(configKey string, globalConfig config.IntOption) config.BoolOption {
activeAtLevels := lp.wrapIntOption(configKey, globalConfig)
return func() bool {
return uint8(activeAtLevels())&status.SecurityLevelNormal > 0
}
}
func (lp *LayeredProfile) wrapBoolOption(configKey string, globalConfig config.BoolOption) config.BoolOption { func (lp *LayeredProfile) wrapBoolOption(configKey string, globalConfig config.BoolOption) config.BoolOption {
var revCnt uint64 = 0 var revCnt uint64 = 0
var value bool var value bool
@ -561,10 +552,3 @@ func (lp *LayeredProfile) wrapStringOption(configKey string, globalConfig config
return value return value
} }
} }
func max(a, b uint8) uint8 {
if a > b {
return a
}
return b
}

View file

@ -53,8 +53,8 @@ const DisplayHintSecurityLevel string = "security level"
// Security levels. // Security levels.
const ( const (
// SecurityLevelOff uint8 = 0 SecurityLevelOff uint8 = 0
SecurityLevelNormal uint8 = 1 SecurityLevelNormal uint8 = 1
// SecurityLevelHigh uint8 = 2 SecurityLevelHigh uint8 = 2
// SecurityLevelExtreme uint8 = 4 SecurityLevelExtreme uint8 = 4
) )