Compare commits

...

3 Commits

Author SHA1 Message Date
Denton Gentry
1d7592eb11 VERSION.txt: this is v1.12.1
Signed-off-by: Denton Gentry <dgentry@tailscale.com>
2021-07-27 17:18:46 -07:00
David Crawshaw
804804eb6e net/dns/resolver: EDNS OPT record off-by-one
I don't know how to get access to a real packet. Basing this commit
entirely off:

       +------------+--------------+------------------------------+
       | Field Name | Field Type   | Description                  |
       +------------+--------------+------------------------------+
       | NAME       | domain name  | MUST be 0 (root domain)      |
       | TYPE       | u_int16_t    | OPT (41)                     |
       | CLASS      | u_int16_t    | requestor's UDP payload size |
       | TTL        | u_int32_t    | extended RCODE and flags     |
       | RDLEN      | u_int16_t    | length of all RDATA          |
       | RDATA      | octet stream | {attribute,value} pairs      |
       +------------+--------------+------------------------------+

From https://datatracker.ietf.org/doc/html/rfc6891#section-6.1.2

Signed-off-by: David Crawshaw <crawshaw@tailscale.com>
2021-07-27 17:16:11 -07:00
Denton Gentry
188a7f6bc4 VERSION.txt: this is v1.12.0
Signed-off-by: Denton Gentry <dgentry@tailscale.com>
2021-07-27 07:11:09 -07:00
2 changed files with 4 additions and 3 deletions

View File

@@ -1 +1 @@
1.11.0
1.12.1

View File

@@ -125,6 +125,7 @@ func clampEDNSSize(packet []byte, maxSize uint16) {
return
}
// https://datatracker.ietf.org/doc/html/rfc6891#section-6.1.2
opt := packet[len(packet)-optFixedBytes:]
if opt[0] != 0 {
@@ -141,8 +142,8 @@ func clampEDNSSize(packet []byte, maxSize uint16) {
// Be conservative and don't touch unknown versions.
return
}
// Ignore flags in opt[7:9]
if binary.BigEndian.Uint16(opt[10:12]) != 0 {
// Ignore flags in opt[6:9]
if binary.BigEndian.Uint16(opt[9:11]) != 0 {
// RDLEN must be 0 (no variable length data). We're at the end of the
// packet so this should be 0 anyway)..
return