From f64e274c4e66b9352f83e40b2abca7eaaad8717b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maciej=20Kr=C3=BCger?= Date: Thu, 7 Apr 2022 14:56:36 +0200 Subject: [PATCH] web-static-ip: fix ui --- .../luasrc/lib/gluon/config-mode/model/admin/staticip.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package/gluon-web-static-ip/luasrc/lib/gluon/config-mode/model/admin/staticip.lua b/package/gluon-web-static-ip/luasrc/lib/gluon/config-mode/model/admin/staticip.lua index eb5b2308..932b25db 100644 --- a/package/gluon-web-static-ip/luasrc/lib/gluon/config-mode/model/admin/staticip.lua +++ b/package/gluon-web-static-ip/luasrc/lib/gluon/config-mode/model/admin/staticip.lua @@ -39,7 +39,7 @@ local function intf_setting(intf, desc, enabled) local v4addr = uci:get('gluon-static-ip', intf, 'ip4') if site.node_prefix4() and v4addr and site.node_prefix4_temporary() then - local tmp = ip.new(site.node_prefix4(), site.node_prefix4()) + local tmp = ip.new(site.node_prefix4(), site.node_prefix4_range()) local isTmp = tmp:contains(ip.new(v4addr):host()) if isTmp then @@ -75,7 +75,7 @@ local function intf_setting(intf, desc, enabled) end end - if site.prefix6() then + if site.prefix6() and (intf == 'loopback' or site.tmpIp6Everywhere(false)) then local v6addr = uci:get('gluon-static-ip', intf, 'ip6') if site.node_prefix6() and v6addr and site.node_prefix6_temporary() then @@ -102,7 +102,7 @@ local function intf_setting(intf, desc, enabled) function v6:write(data) -- TODO: validate via datatype - if data == '' and (not site.node_prefix6() or (not site.tmpIp6Everywhere() or intf ~= 'loopback')) then + if data == '' and (not site.node_prefix6() or (not site.tmpIp6Everywhere(false) or intf ~= 'loopback')) then data = null end