diff --git a/exec/load/dns.js b/exec/load/dns.js index afbd4abfc03a6820800d17ed3a7a120d543f6331..18be8088231fb76430b678756ee6d51e09885073 100644 --- a/exec/load/dns.js +++ b/exec/load/dns.js @@ -232,6 +232,15 @@ var DNS = new function(servers) q = DNS.outstanding[id]; delete DNS.outstanding[id]; + ret.id = id; + ret.response = !!(ascii(resp[2]) & 1); + ret.opcode = (ascii(resp[2]) & 0x1e) >> 1; + ret.authoritative = !!(ascii(resp[2]) & (1<<5)); + ret.truncation = !!(ascii(resp[2]) & (1<<6)); + ret.recusrion = !!(ascii(resp[2]) & (1<<7)); + ret.reserved = ascii(resp[3]) & 7; + ret.rcode = ascii(resp[3] & 0xf1) >> 3; + queries = DNS.string_to_int16(resp.substr(4, 2)); answers = DNS.string_to_int16(resp.substr(6, 2)); nameservers = DNS.string_to_int16(resp.substr(8, 2));