diff --git a/programs/nslookup/src/main.cpp b/programs/nslookup/src/main.cpp index 652ca8f1..a9f66677 100644 --- a/programs/nslookup/src/main.cpp +++ b/programs/nslookup/src/main.cpp @@ -86,7 +86,7 @@ int main(int argc, char* argv[]) { auto questions = tlib::switch_endian_16(dns_header->questions); auto answers = tlib::switch_endian_16(dns_header->answers); - auto flags = dns_header->flags; + auto flags = tlib::switch_endian_16(dns_header->flags); auto qr = flags >> 15; // Only handle Response diff --git a/tlib/src/dns.cpp b/tlib/src/dns.cpp index 1658b331..2d4e82de 100644 --- a/tlib/src/dns.cpp +++ b/tlib/src/dns.cpp @@ -124,7 +124,7 @@ std::expected tlib::dns::resolve(const std::string& domain, size_t auto questions = tlib::switch_endian_16(dns_header->questions); auto answers = tlib::switch_endian_16(dns_header->answers); - auto flags = dns_header->flags; + auto flags = tlib::switch_endian_16(dns_header->flags); auto qr = flags >> 15; // Only handle Response