mirror of
https://github.com/sshuttle/sshuttle.git
synced 2025-04-27 12:49:31 +02:00
Merge pull request #617 from patrislav1/bugfix-iptables-wait
Fix firewall setup/teardown failure on xtable lock
This commit is contained in:
commit
4257c8d34e
@ -17,7 +17,7 @@ def ipt_chain_exists(family, table, name):
|
|||||||
cmd = 'iptables'
|
cmd = 'iptables'
|
||||||
else:
|
else:
|
||||||
raise Exception('Unsupported family "%s"' % family_to_string(family))
|
raise Exception('Unsupported family "%s"' % family_to_string(family))
|
||||||
argv = [cmd, '-t', table, '-nL']
|
argv = [cmd, '-w', '-t', table, '-nL']
|
||||||
try:
|
try:
|
||||||
output = ssubprocess.check_output(argv, env=get_env())
|
output = ssubprocess.check_output(argv, env=get_env())
|
||||||
for line in output.decode('ASCII').split('\n'):
|
for line in output.decode('ASCII').split('\n'):
|
||||||
@ -29,9 +29,9 @@ def ipt_chain_exists(family, table, name):
|
|||||||
|
|
||||||
def ipt(family, table, *args):
|
def ipt(family, table, *args):
|
||||||
if family == socket.AF_INET6:
|
if family == socket.AF_INET6:
|
||||||
argv = ['ip6tables', '-t', table] + list(args)
|
argv = ['ip6tables', '-w', '-t', table] + list(args)
|
||||||
elif family == socket.AF_INET:
|
elif family == socket.AF_INET:
|
||||||
argv = ['iptables', '-t', table] + list(args)
|
argv = ['iptables', '-w', '-t', table] + list(args)
|
||||||
else:
|
else:
|
||||||
raise Exception('Unsupported family "%s"' % family_to_string(family))
|
raise Exception('Unsupported family "%s"' % family_to_string(family))
|
||||||
debug1('%s' % ' '.join(argv))
|
debug1('%s' % ' '.join(argv))
|
||||||
|
Loading…
Reference in New Issue
Block a user