From 641aae5effe70aae9ddd84fcaaa9a61f14c4caf9 Mon Sep 17 00:00:00 2001 From: Ycarus Date: Fri, 3 Aug 2018 15:00:39 +0200 Subject: [PATCH] Fix WAN IPv6 check --- .../luasrc/controller/openmptcprouter.lua | 28 +++++++++++++------ 1 file changed, 20 insertions(+), 8 deletions(-) diff --git a/luci-app-openmptcprouter/luasrc/controller/openmptcprouter.lua b/luci-app-openmptcprouter/luasrc/controller/openmptcprouter.lua index aff238cfc..e42fb85b8 100644 --- a/luci-app-openmptcprouter/luasrc/controller/openmptcprouter.lua +++ b/luci-app-openmptcprouter/luasrc/controller/openmptcprouter.lua @@ -672,14 +672,26 @@ function interfaces_status() if type(ipv6_result) == "table" and #ipv6_result > 0 then local ipv6_addr_test for k,v in ipairs(ipv6_result) do - if v.RecursiveDnsServer and type(v.RecursiveDnsServer) ~= "table" then - ipv6_addr_test = sys.exec('ip -6 addr | grep ' .. v.RecursiveDnsServer) - end - end - if ipv6_addr_test == "" then - ipv6_discover = 'DETECTED' - if connectivity == "OK" then - connectivity = 'WARNING' + if v.RecursiveDnsServer then + if type(v.RecursiveDnsServer) ~= "table" then + ipv6_addr_test = sys.exec('ip -6 addr | grep ' .. v.RecursiveDnsServer) + if ipv6_addr_test == "" then + ipv6_discover = 'DETECTED' + if connectivity == "OK" then + connectivity = 'WARNING' + end + end + else + for i,j in ipairs(ipv6_result) do + ipv6_addr_test = sys.exec('ip -6 addr | grep ' .. j) + if ipv6_addr_test == "" then + ipv6_discover = 'DETECTED' + if connectivity == "OK" then + connectivity = 'WARNING' + end + end + end + end end end end