From 503e0627af583e36f5581a630140c360bde58061 Mon Sep 17 00:00:00 2001 From: onefang Date: Fri, 19 Nov 2021 23:39:52 +1000 Subject: Strip out DNS-RR duplicates. --- apt-panopticon.lua | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/apt-panopticon.lua b/apt-panopticon.lua index 7e3b4ef..7defaad 100755 --- a/apt-panopticon.lua +++ b/apt-panopticon.lua @@ -198,6 +198,26 @@ gatherIPs = function (host) if "yes" == m.DNSRR then gatherIPs(m.FQDN) IP[host][m.FQDN] = IP[m.FQDN] + -- Strip them out so we don't test them twice. + for l, n in pairs(IP[m.FQDN]) do + if type(n) == 'table' then + for h, p in pairs(n) do + for j, o in pairs(IP[host]['deb.roundr.devuan.org']) do + if h == j then IP[host][m.FQDN][l][h] = nil end + end + o = 0 + for j in pairs(IP[host][m.FQDN][l]) do o = o + 1 end + if 0 == o then IP[host][m.FQDN][l] = nil end + end + else + for j, o in pairs(IP[host]['deb.roundr.devuan.org']) do + if l == j then IP[host][m.FQDN][l] = nil end + end + end + o = 0 + for j in pairs(IP[host][m.FQDN]) do o = o + 1 end + if 0 == o then IP[host][m.FQDN] = nil end + end end end end -- cgit v1.1