From 49e60861b1acb5dc9108d0a21929668ae78a2de9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maciej=20Kr=C3=BCger?= Date: Mon, 16 May 2022 09:41:32 +0200 Subject: [PATCH] gluon-static-ip: use gluon protos --- .../luasrc/lib/gluon/upgrade/540-static-ip | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/package/gluon-static-ip/luasrc/lib/gluon/upgrade/540-static-ip b/package/gluon-static-ip/luasrc/lib/gluon/upgrade/540-static-ip index c9d44fd6..64236b77 100755 --- a/package/gluon-static-ip/luasrc/lib/gluon/upgrade/540-static-ip +++ b/package/gluon-static-ip/luasrc/lib/gluon/upgrade/540-static-ip @@ -114,8 +114,7 @@ local function static_ip(name, ifname, macaddr, actually_use) return end - uci:set('network', name, 'ipaddr', ip4:host():string()) - uci:set('network', name, 'netmask', ip4:mask():string()) + uci:set('network', name, 'ipaddr', ip4:string()) elseif name ~= 'loopback' then if uci:get('network', name, 'ipaddr') then uci:del('network', name, 'ipaddr') @@ -140,11 +139,12 @@ local function static_ip(name, ifname, macaddr, actually_use) end end else - if uci:get('network', name, 'proto') == 'static' then - uci:del('network', name, 'ipaddr') - uci:del('network', name, 'netmask') + if uci:get('network', name, 'ip6addr') ~= nil then uci:del('network', name, 'ip6addr') - end + end + if uci:get('network', name, 'ipaddr') ~= nil then + uci:del('network', name, 'ipaddr') + end end end