mirror of
https://github.com/qdm12/gluetun.git
synced 2026-07-30 17:03:22 +02:00
fix(firewall/iptables): shared mutex for both iptables and ip6tables
This commit is contained in:
@@ -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),
|
||||
|
||||
Reference in New Issue
Block a user