From a76ffcbf5ed4295d45e95d2f668c86bdf0d1ba8b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maciej=20Kr=C3=BCger?= Date: Wed, 15 Dec 2021 09:28:03 +0100 Subject: [PATCH] static-ip fix storing values --- .../gluon-static-ip/luasrc/lib/gluon/upgrade/240-static-ip | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/package/gluon-static-ip/luasrc/lib/gluon/upgrade/240-static-ip b/package/gluon-static-ip/luasrc/lib/gluon/upgrade/240-static-ip index 79eaeb02..33b3ec65 100755 --- a/package/gluon-static-ip/luasrc/lib/gluon/upgrade/240-static-ip +++ b/package/gluon-static-ip/luasrc/lib/gluon/upgrade/240-static-ip @@ -16,7 +16,7 @@ end local function static_ip_4(name, ifname, macaddr, actually_use) -- actually_use = if ip should be applied to interface or not -- if set and actually_use=false then it will be removed - local static4 = uci:get('gluon-static-ip', interface, 'ip4') + local static4 = uci:get('gluon-static-ip', name, 'ip4') if not static4 then local prefixOverflow = IPV4_PREFIX_MAX - tmp4:prefix() @@ -29,7 +29,9 @@ local function static_ip_4(name, ifname, macaddr, actually_use) end static4 = tmp4:add(ipnum):string() - uci:set('gluon-static-ip', interface, 'ip4', static4) + uci:section('gluon-static-ip', 'interface', name, { + ip4 = static4, + }) end if actually_use then