libcli/dns: Fix TCP fallback
authorVolker Lendecke <vl@samba.org>
Thu, 20 Jan 2022 11:23:43 +0000 (12:23 +0100)
committerJeremy Allison <jra@samba.org>
Thu, 20 Jan 2022 18:01:41 +0000 (18:01 +0000)
commitf60780c8b633ece61c952122aee4f313edb26010
tree28596cea3cc1f87df23c8a3cb0689503aab20047
parentd1891a0c4f6f639f60d2063ca4c54d3b283e3636
libcli/dns: Fix TCP fallback

A customer has come across a DNS server that really just cuts a SRV
reply if it's too long. This makes the packet invalid according to
ndr_pull and according to wireshark. DNS_FLAG_TRUNCATION is however
set. As this seems to be legal according to the DNS RFCs, we need to
hand-parse the first two uint16's and look whether DNS_FLAG_TRUNCATION
is set.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Thu Jan 20 18:01:41 UTC 2022 on sn-devel-184
libcli/dns/dns.c