fix(firewall/iptables): shared mutex for both iptables and ip6tables

This commit is contained in:
Quentin McGaw
2026-03-23 14:09:26 +00:00
parent 1b871496ea
commit c5b20a3b06
3 changed files with 10 additions and 8 deletions
+3
View File
@@ -215,6 +215,9 @@ func (c *Config) redirectPort(ctx context.Context, intf string,
interfaceFlag = ""
}
c.iptablesMutex.Lock()
defer c.iptablesMutex.Unlock()
err = c.runIptablesInstructions(ctx, []string{
fmt.Sprintf("-t nat %s PREROUTING %s -p tcp --dport %d -j REDIRECT --to-ports %d",
appendOrDelete(remove), interfaceFlag, sourcePort, destinationPort),