From: Vladimír Čunát Date: Mon, 13 Mar 2017 18:08:29 +0000 (+0100) Subject: version: don't depend on rr2str output style X-Git-Tag: v1.3.0~23^2~54^2~3 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ec4ffdb41d45592be662829bd791362b5341b838;p=thirdparty%2Fknot-resolver.git version: don't depend on rr2str output style It would break after making rr2str pretty-print the data. --- diff --git a/modules/version/version.lua.in b/modules/version/version.lua.in index 461d19329..1e3ba3ce9 100644 --- a/modules/version/version.lua.in +++ b/modules/version/version.lua.in @@ -45,8 +45,7 @@ end --Parses version from server and compares it to the installed one local function parse(record) local output = "" - local str = getLastWord(kres.rr2str(record)) - str = hex2string(str) + local str = record:tostring(0) local CVE = parseCVE(str) local version = parseVersion(str) local localVersion = '@VERSION@' @@ -66,7 +65,7 @@ end local function request (answer) local pkt = kres.pkt_t(answer) if pkt:rcode() == kres.rcode.NOERROR then - parse(pkt:section(kres.section.ANSWER)[1]) + parse(pkt:rrsets(kres.section.ANSWER)[1]) else print ('Request for version ended with rcode: ', pkt:rcode()) return @@ -104,4 +103,4 @@ function M.deinit() if M.ev then event.cancel(M.ev) end end -return M \ No newline at end of file +return M