diff options
Diffstat (limited to 'sshuttle/server.py')
-rw-r--r-- | sshuttle/server.py | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/sshuttle/server.py b/sshuttle/server.py index 645252b..b0c4367 100644 --- a/sshuttle/server.py +++ b/sshuttle/server.py @@ -152,7 +152,7 @@ class Hostwatch: class DnsProxy(Handler): - def __init__(self, mux, chan, request, to_nameserver, ttl): + def __init__(self, mux, chan, request, to_nameserver): Handler.__init__(self, []) self.timeout = time.time() + 30 self.mux = mux @@ -162,7 +162,6 @@ class DnsProxy(Handler): self.peers = {} self.to_ns_peer = None self.to_ns_port = None - self.ttl = ttl if to_nameserver is None: self.to_nameserver = None else: @@ -192,7 +191,6 @@ class DnsProxy(Handler): family, sockaddr = self._addrinfo(peer, port) sock = socket.socket(family, socket.SOCK_DGRAM) - sock.setsockopt(socket.SOL_IP, socket.IP_TTL, self.ttl) sock.connect(sockaddr) self.peers[sock] = peer @@ -241,15 +239,13 @@ class DnsProxy(Handler): class UdpProxy(Handler): - def __init__(self, mux, chan, family, ttl): + def __init__(self, mux, chan, family): sock = socket.socket(family, socket.SOCK_DGRAM) Handler.__init__(self, [sock]) self.timeout = time.time() + 30 self.mux = mux self.chan = chan self.sock = sock - if family == socket.AF_INET: - self.sock.setsockopt(socket.SOL_IP, socket.IP_TTL, ttl) def send(self, dstip, data): debug2('UDP: sending to %r port %d' % dstip) @@ -273,7 +269,7 @@ class UdpProxy(Handler): def main(latency_control, latency_buffer_size, auto_hosts, to_nameserver, - auto_nets, ttl): + auto_nets): try: helpers.logprefix = ' s: ' debug1('Starting server with Python version %s' @@ -350,7 +346,7 @@ def main(latency_control, latency_buffer_size, auto_hosts, to_nameserver, def dns_req(channel, data): debug2('Incoming DNS request channel=%d.' % channel) - h = DnsProxy(mux, channel, data, to_nameserver, ttl) + h = DnsProxy(mux, channel, data, to_nameserver) handlers.append(h) dnshandlers[channel] = h mux.got_dns_req = dns_req @@ -381,7 +377,7 @@ def main(latency_control, latency_buffer_size, auto_hosts, to_nameserver, raise Fatal('UDP connection channel %d already open' % channel) else: - h = UdpProxy(mux, channel, family, ttl) + h = UdpProxy(mux, channel, family) handlers.append(h) udphandlers[channel] = h mux.got_udp_open = udp_open |