[Netfilter] Do not delete SNAT rule if not on first position
parent
57aa379a2a
commit
45ecc26a12
|
@ -301,12 +301,12 @@ def snat4(snat_target):
|
|||
print log['message']
|
||||
chain.insert_rule(get_snat4_rule())
|
||||
table.commit()
|
||||
else:
|
||||
for position, item in enumerate(chain.rules):
|
||||
if item == get_snat4_rule():
|
||||
if position != 0:
|
||||
chain.delete_rule(get_snat4_rule())
|
||||
table.commit()
|
||||
#else:
|
||||
# for position, item in enumerate(chain.rules):
|
||||
# if item == get_snat4_rule():
|
||||
# if position != 0:
|
||||
# chain.delete_rule(get_snat4_rule())
|
||||
# table.commit()
|
||||
table.autocommit = True
|
||||
except:
|
||||
print 'Error running SNAT4, retrying...'
|
||||
|
|
|
@ -318,7 +318,7 @@ services:
|
|||
- acme
|
||||
|
||||
netfilter-mailcow:
|
||||
image: mailcow/netfilter:1.19
|
||||
image: mailcow/netfilter:1.20
|
||||
build: ./data/Dockerfiles/netfilter
|
||||
stop_grace_period: 30s
|
||||
depends_on:
|
||||
|
|
Loading…
Reference in New Issue