]> git.ipfire.org Git - thirdparty/knot-resolver.git/commitdiff
version: don't depend on rr2str output style
authorVladimír Čunát <vladimir.cunat@nic.cz>
Mon, 13 Mar 2017 18:08:29 +0000 (19:08 +0100)
committerVladimír Čunát <vladimir.cunat@nic.cz>
Wed, 15 Mar 2017 14:33:44 +0000 (15:33 +0100)
It would break after making rr2str pretty-print the data.

modules/version/version.lua.in

index 461d1932911b448f02bd0fba7ef2baae3db6d28e..1e3ba3ce96001c9d3e0fbefd4135065b6ca6e1ca 100644 (file)
@@ -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