2
0
mirror of https://github.com/acepanel/panel.git synced 2026-02-04 03:07:20 +08:00

fix: 出站规则下,必须指定具体的地址,否则会添加成入站规则,close #822

This commit is contained in:
2025-06-14 18:00:28 +08:00
parent 0acbb05d3f
commit d90396c8ea

View File

@@ -207,6 +207,11 @@ func (r *Firewall) Port(rule FireInfo, operation Operation) error {
}
func (r *Firewall) RichRules(rule FireInfo, operation Operation) error {
// 出站规则下,必须指定具体的地址,否则会添加成入站规则
if rule.Direction == "out" && rule.Address == "" {
return fmt.Errorf("outbound rules must specify an address")
}
protocols := strings.Split(string(rule.Protocol), "/")
for protocol := range slices.Values(protocols) {
var ruleBuilder strings.Builder