mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2025-01-31 14:08:06 +08:00
parent
b38abf852d
commit
8a7e61e9e5
@ -156,7 +156,7 @@ func (f *Firewall) RichRules(rule FireInfo, operation string) error {
|
||||
}
|
||||
ruleStr = fmt.Sprintf("rule source ipset=%s %s", rule.Address, rule.Strategy)
|
||||
} else {
|
||||
ruleStr = "rule family=ipv4 "
|
||||
ruleStr = "rule "
|
||||
if len(rule.Address) != 0 {
|
||||
ruleStr += fmt.Sprintf("source address=%s ", rule.Address)
|
||||
}
|
||||
|
@ -207,6 +207,9 @@ func (f *Ufw) PortForward(info Forward, operation string) error {
|
||||
func (f *Ufw) loadInfo(line string, fireType string) FireInfo {
|
||||
fields := strings.Fields(line)
|
||||
var itemInfo FireInfo
|
||||
if strings.Contains(line, "LIMIT") || strings.Contains(line, "ALLOW FWD") {
|
||||
return itemInfo
|
||||
}
|
||||
if len(fields) < 4 {
|
||||
return itemInfo
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user