소스 검색

[Netfilter] Revert SNAT rule check, todo: check DNS with SNAT enabled

andryyy 7 년 전
부모
커밋
cfab7274b7
1개의 변경된 파일6개의 추가작업 그리고 6개의 파일을 삭제
  1. 6 6
      data/Dockerfiles/netfilter/server.py

+ 6 - 6
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...'