David Fifield
f168777a13
dns Message.Opcode method.
2020-04-19 10:33:40 -06:00
David Fifield
4b0b144257
Consolidate the authoritative domain check.
...
Formerly this was split into two pieces: one that did the domain check
and set the AA bit, and another that checked the AA bit and returned an
error if it was not set. It was done in two parts because the check for
UDP payload size occurred in the middle. Since 59f03791 the payload
check is moved to the end, so we can do the authoritative domain check
in one piece.
2020-04-19 10:28:56 -06:00
David Fifield
0567fa9abb
Remove addr fro "cannot parse DNS query" log message.
2020-04-19 09:44:05 -06:00
David Fifield
e9a98c3aef
Avoid logging EOF and ErrClosedPipe errors.
...
smux Stream.WriteTo may return io.EOF, which breaks the contract of
io.Copy that says it should not return io.EOF. smux.Stream doesn't have
a unidirectional shutdown, so we always end up slamming it shut in both
directions and leave the other direction with a broken pipe.
2020-04-19 02:13:48 -06:00
David Fifield
34b7e82af4
More logging of query validation errors in server.
2020-04-19 01:17:33 -06:00
David Fifield
98bf401738
Use NXDOMAIN rather than FORMERR for QTYPE != TXT.
2020-04-19 01:13:35 -06:00
David Fifield
59f03791df
Do the payload size check after the TXT and base32 checks.
...
That way we can respond with NXDOMAIN rather than FORMERR to more of the
random queries that arrive.
2020-04-19 00:59:04 -06:00
David Fifield
04e1295e52
Infer a payload size of 512 even when there is no OPT RR.
...
Before we were inferring a size of 0. It would still be rejected for
being too small, but was confusing with the log messages I am adding.
2020-04-19 00:53:34 -06:00
David Fifield
294f1acc7d
Fix second AA check.
2020-04-19 00:53:34 -06:00
David Fifield
1e57ed8d42
Add missing return for EDNS version != 0.
2020-04-19 00:53:34 -06:00
David Fifield
7fad23ceca
Reduce maxUDPPayload to 1232 for compatibility with Quad9.
2020-04-19 00:53:34 -06:00
David Fifield
0a630f91c5
Log stream begin/end in server, log conv in client.
2020-04-18 19:05:23 -06:00
David Fifield
b1bf9164a7
-privkey-file and -pubkey-file options.
2020-04-18 17:56:45 -06:00
David Fifield
505db3ec23
Server -privkey option and client -pubkey option.
2020-04-18 17:35:32 -06:00
David Fifield
cd03021417
Note -udp is required on server.
2020-04-18 16:02:14 -06:00
David Fifield
b98eb2c75e
Move dummyAddr to turbotunnel.DummyAddr.
2020-04-18 16:02:14 -06:00
David Fifield
f69e4e0d71
Truncation and TC bit in responses.
2020-04-18 16:02:14 -06:00
David Fifield
e53d332eca
Reduce response delay to 1 s.
...
To be below the reported Quad9 timeout.
2020-04-18 16:02:14 -06:00
David Fifield
7f3e9e4571
Overlay a noise layer atop KCP.
2020-04-18 14:34:10 -06:00
David Fifield
f8b9d73493
Switch up order of query checks in server.
...
We should set the AA bit if it applies, even if there are things wrong
with the query. An EDNS(0)-related error supersedes all others.
2020-04-18 14:34:10 -06:00
David Fifield
0a568a386b
Need to set RR class in responses.
...
The lack of this (Class==0) worked fine with Google UDP and DoH, and
Cloudflare UDP, but failed with Cloudflare DoH (the DoH resolver
stripped the TXT RR).
2020-04-18 14:34:04 -06:00
David Fifield
f2abcbf4de
Larger downstream capacity.
2020-04-18 14:33:39 -06:00
David Fifield
0022cdd16c
EDNS check
2020-04-18 14:33:39 -06:00
David Fifield
163ae7f1b8
Per-message byte limit depends on name length.
2020-04-18 14:33:39 -06:00
David Fifield
f1ee951fd6
Timer priority.
2020-04-18 14:33:39 -06:00
David Fifield
443a3ac855
delay resp
2020-04-18 14:33:39 -06:00
David Fifield
8aace665d5
Bundle multiple packets downstream.
2020-04-18 14:33:36 -06:00
David Fifield
0a8e5f5b72
Packet framing downstream.
2020-04-18 14:29:30 -06:00
David Fifield
2050034fb1
Factor out separate sending and receiving threads.
2020-04-18 14:29:30 -06:00
David Fifield
5bb844b00a
Logging in server.
2020-04-18 14:29:30 -06:00
David Fifield
933f17de78
Packetization and padding in the client→server direction.
2020-04-18 14:29:29 -06:00
David Fifield
0e72afd1e7
Downstream MTU.
2020-04-18 14:29:14 -06:00
David Fifield
3b48d1aee1
Send full 8-byte ClientID
...
Sending just 4 bytes and relying on the convid for the remaining bytes
doesn't work for empty polling requests. Could probably just eliminate
the convid and make it a static constant before feeding to KCP.
2020-04-18 14:28:55 -06:00
David Fifield
9f72a8a87d
client
2020-04-18 14:28:53 -06:00
David Fifield
cfbbc9aaee
Better command-line usage message.
2020-04-18 14:23:11 -06:00
David Fifield
6633ee8b8d
Exchange payloads.
2020-04-18 14:23:11 -06:00
David Fifield
32bf8ef5db
Generating a response.
2020-04-18 13:18:08 -06:00
David Fifield
57dbb4a4a8
MessageFromWireFormat
2020-04-18 13:18:08 -06:00
David Fifield
cdeecf2ec6
Starting on server.
2020-04-18 13:18:04 -06:00