优化nftables查找程序

This commit is contained in:
GoEdgeLab
2023-04-05 09:33:03 +08:00
parent 9ba3dc8172
commit d13018c51f
3 changed files with 25 additions and 29 deletions

View File

@@ -90,7 +90,7 @@ func (this *DDoSProtectionManager) Apply(config *ddosconfigs.ProtectionConfig) e
}
remotelogs.Println("FIREWALL", "change DDoS protection config")
if len(NftExePath()) == 0 {
if len(nftables.NftExePath()) == 0 {
return errors.New("can not find nft command")
}
@@ -156,7 +156,7 @@ func (this *DDoSProtectionManager) Apply(config *ddosconfigs.ProtectionConfig) e
// 添加TCP规则
func (this *DDoSProtectionManager) addTCPRules(tcpConfig *ddosconfigs.TCPConfig) error {
var nftExe = NftExePath()
var nftExe = nftables.NftExePath()
if len(nftExe) == 0 {
return nil
}