Some DNS servers respond to requests an empty checksum field. Tayga does not forward these responses, thus making those DNS servers inaccessible through Tayga. In IPv4, UDP checksums are optional. RFC768 says: UDP checksums are required in IPv6. Tayga doesn't know how to fix the checksum field in this case, so it drops such packets on the floor: In practice, this limits access to sites whose DNS servers only speak IPv4 and don't include checksums. For example, ESA (the European Space Agency) uses the domain name "esa.int". This domain has 4 nameservers, all of which are IPv4-only, and all of which omit checksums. When I make a query, by running `host -t ns esa.int ns1.esa.int` on an ipv4-enabled host, `tshark -V` says this about the response: Making the equivalent query from behind Tayga never got an answer, because Tayga dropped the response packet. A recursive resolver running behind Tayga can never resolve "www.esa.int", because Tayga drops all the responses. I think Tayga should populate null UDP checksum fields when forwarding from v4 to v6. This would greatly improve interoperability with european space agencies, and possibly other sites and services too.
I've been trying to cook up a patch for this, but so far my checksum calculations are wrong. If I manage to get it working, I'll post a patch here.
I've been trying to cook up a patch for this, but so far my checksum calculations are wrong. If I manage to get it working, I'll post a patch here.
Here is an imperfect patch that calculates the UDP checksum if none was
present.
This allows the 4to6 machinery to do its thing, the aforementioned DNS
responses go through successfully, and now I can access the ESA
website. (Hooray!)
The imperfection is that I had to add an asm("":::"memory") memory
barrier, after the newly assigned checksum gets written to the checksum
field in the UDP header. Without this memory barrier, it wasn't working
for me (arm64, gcc 14.2.0). When I temporarily changed -O2 to -O1, the
problem went away. The memory barrier gets it working with -O2. I
guess it's an aliasing problem, the compiler reordered something it
shouldn't have, but I don't fully understand it. Here's hoping this
patch can serve as a starting point for something cleaner.
Hello, Thanks, I will look into it. I can’t promise when, though, but it’s in my backlog.
Note, the new upstream fork (see #1107302) has a fix for this: https://github.com/apalrd/tayga/pull/76 They make the behavior configurable, and it looks like the "calc" option covers my use-case. Thanks, Mark
Hi Mark, Thanks for the info! We're already planning to switch to Andrew's fork in the next Debian release, but working on CLAT integration is higher priorty right now. Nice. Didn't know about the option. I'd be curious what your use-case looks like exactly? I've been on the fence about whether having special handling for this is actually still useful in the field (for a Linux kernel SIIT implementation I'm working on). Thanks, --Daniel