Reboot needs ip information from active /etc/config not /etc/config.mesh (#1040)

This commit is contained in:
Tim Wilkinson 2023-12-21 11:06:03 -08:00 committed by GitHub
parent 80a4bbb7ae
commit 56043e0e0b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 2 deletions

View File

@ -477,6 +477,7 @@ function cursor_get(a, b, c)
end
function reboot()
local c = uci.cursor()
local node = aredn.info.get_nvram("node")
if node == "" then
node = "Node"
@ -493,8 +494,8 @@ function reboot()
fromlan = validate_same_subnet(browser, lanip, lanmask)
if fromlan then
lanmask = ip_to_decimal(lanmask)
local cfgip = cursor_get("network", "lan", "ipaddr")
local cfgmask = ip_to_decimal(cursor_get("network", "lan", "netmask"))
local cfgip = c:get("network", "lan", "ipaddr")
local cfgmask = ip_to_decimal(c:get("network", "lan", "netmask"))
if lanmask ~= cfgmask or nixio.bit.band(ip_to_decimal(lanip), lanmask) ~= nixio.bit.band(ip_to_decimal(cfgip), cfgmask) then
subnet_change = true
end