[Dnsmasq-discuss] dnsmasq query via tcp return always in 2 packets ?

Jim Bos jim876 at xs4all.nl
Sat Apr 20 12:59:28 BST 2013



I got errors trying to use tcl library to query via tcp to dnsmasq
( http://tcllib.sourceforge.net/doc/tcllib_dns.html )

looking with wireshark what was happening I noticed that dnsmasq when
queried via tcp always seems to reply with 2 tcp packets. The DNS
payload for tcp starts with a length field consisting of 2 bytes.
dnsmasq always appears to send the first byte (typically a zero for
replies with less then 255 bytes) followed by 2nd length field byte and
the rest of the message in subsequent package.

That's obviously not an error for a tcp stream (and I haven't verified
that's the reason for the errors in the library) but does seem
sub-optimal and not something other nameservers do.
(verified by doing   dig +tcp google.com @8.8.8.8 )

I can supply a wireshark dump but this is very easy to reproduce,
is there a reason dnsmasq is doing this ?

Thanks,

Jim



More information about the Dnsmasq-discuss mailing list