(*args)
| 46 | |
| 47 | _no_ttl_module = False |
| 48 | def 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 |
no test coverage detected