MCPcopy Create free account
hub / github.com/apenwarr/sshuttle / ipt_ttl

Function ipt_ttl

firewall.py:48–64  ·  view source on GitHub ↗
(*args)

Source from the content-addressed store, hash-verified

46
47_no_ttl_module = False
48def ipt_ttl(*args):
49 global _no_ttl_module
50 if not _no_ttl_module:
51 # we avoid infinite loops by generating server-side connections
52 # with ttl 42. This makes the client side not recapture those
53 # connections, in case client == server.
54 try:
55 argsplus = list(args) + ['-m', 'ttl', '!', '--ttl', '42']
56 ipt(*argsplus)
57 except Fatal:
58 ipt(*args)
59 # we only get here if the non-ttl attempt succeeds
60 log('sshuttle: warning: your iptables is missing '
61 'the ttl module.\n')
62 _no_ttl_module = True
63 else:
64 ipt(*args)
65
66
67

Callers 1

do_iptablesFunction · 0.85

Calls 2

iptFunction · 0.85
logFunction · 0.85

Tested by

no test coverage detected