From 45ecc26a12ce04f243613089c66e4af710bdce9b Mon Sep 17 00:00:00 2001 From: andryyy Date: Sat, 1 Dec 2018 21:17:08 +0100 Subject: [PATCH] [Netfilter] Do not delete SNAT rule if not on first position --- data/Dockerfiles/netfilter/server.py | 12 ++++++------ docker-compose.yml | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/data/Dockerfiles/netfilter/server.py b/data/Dockerfiles/netfilter/server.py index 517b91ac..7b0548fc 100644 --- a/data/Dockerfiles/netfilter/server.py +++ b/data/Dockerfiles/netfilter/server.py @@ -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...' diff --git a/docker-compose.yml b/docker-compose.yml index 8942fe6e..d5c0cfa8 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -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: