From e942244ba2576c761518579fc1a441ecb9d2155c Mon Sep 17 00:00:00 2001 From: david Date: Fri, 22 Jan 2010 23:44:51 +0000 Subject: [PATCH] Add a patch to dns.lua from Patrik Karlsson to cope with some mDNS implementations. --- nselib/dns.lua | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/nselib/dns.lua b/nselib/dns.lua index 412f4c455..e5fa3f236 100644 --- a/nselib/dns.lua +++ b/nselib/dns.lua @@ -67,7 +67,13 @@ end local function gotAnswer(rPkt) -- have we even got answers? if #rPkt.answers > 0 then - + + -- some MDNS implementation incorrectly return an empty question section + -- if this is the case return true + if rPkt.questions[1] == nil then + return true + end + -- are those answers not just cnames? if rPkt.questions[1].dtype == types.A then for _, v in ipairs(rPkt.answers) do