From 44010b872921b4c0fe579e5bf69a47a693ccc9e0 Mon Sep 17 00:00:00 2001 From: Simon Rogers Date: Thu, 1 Mar 2018 17:09:52 +0100 Subject: [PATCH] Mask MS bit of class to indicate a unicast response to mDNS --- dns.parser.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/dns.parser.js b/dns.parser.js index 62bf578..92d7b31 100644 --- a/dns.parser.js +++ b/dns.parser.js @@ -143,6 +143,10 @@ pdns.unpack = function (ab) { total += 2; q.byteLength = total - ototal; + // mDNS uses the MS bit of class to request a unicast response + q.unicastResponse = (q.class & 0x8000) !== 0; + q.class &= 0x7fff; + q.className = classes[q.class]; q.typeName = types[q.type];