Skip to content

Commit 7e726bc

Browse files
authored
Merge pull request sshuttle#558 from skuhl/dns-to-none
Fix "DNS request from ... to None" messages.
2 parents 9b036fc + 227412e commit 7e726bc

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

sshuttle/client.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -427,7 +427,13 @@ def ondns(listener, method, mux, handlers):
427427
if t is None:
428428
return
429429
srcip, dstip, data = t
430-
debug1('DNS request from %r to %r: %d bytes\n' % (srcip, dstip, len(data)))
430+
# dstip is None if we are using a method where we can't determine
431+
# the destination IP of the DNS request that we captured from the client.
432+
if dstip is None:
433+
debug1('DNS request from %r: %d bytes\n' % (srcip, len(data)))
434+
else:
435+
debug1('DNS request from %r to %r: %d bytes\n' %
436+
(srcip, dstip, len(data)))
431437
chan = mux.next_channel()
432438
dnsreqs[chan] = now + 30
433439
mux.send(chan, ssnet.CMD_DNS_REQ, data)

0 commit comments

Comments
 (0)