add FixProtect to NetfilterDHook

This commit is contained in:
Vladimir Avtsenov 2025-02-12 04:07:09 +03:00
parent 345b5ff80b
commit 23580da495

View File

@ -159,6 +159,13 @@ func (g *Group) Sync(records *records.Records) error {
} }
func (g *Group) NetfilterDHook(table string) error { func (g *Group) NetfilterDHook(table string) error {
if g.enabled && g.FixProtect && table == "filter" {
err := g.iptables.AppendUnique("filter", "_NDM_SL_FORWARD", "-o", g.Interface, "-m", "state", "--state", "NEW", "-j", "_NDM_SL_PROTECT")
if err != nil {
return fmt.Errorf("failed to fix protect: %w", err)
}
}
return g.ipsetToLink.NetfilterDHook(table) return g.ipsetToLink.NetfilterDHook(table)
} }