From 253b23d303eb08399b1e57edef5179ce060262a8 Mon Sep 17 00:00:00 2001 From: Tim Wilkinson Date: Mon, 28 Feb 2022 12:37:36 -0800 Subject: [PATCH] Missing cursor during reboot (#238) --- files/www/cgi-bin/setup | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/files/www/cgi-bin/setup b/files/www/cgi-bin/setup index cdebe4ba..2ef6efbb 100755 --- a/files/www/cgi-bin/setup +++ b/files/www/cgi-bin/setup @@ -155,9 +155,10 @@ function reboot() fromlan = validate_same_subnet(browser, lanip, lanmask) if fromlan then lanmask = ip_to_decimal(lanmask) + local cursor = uci:cursor() local cfgip = cursor:get("network", "lan", "ipaddr") local cfgmask = ip_to_decimal(cursor:get("network", "lan", "netmask")) - if lanmask ~= cfgmask or decimal_to_ip(nixio.bit.band(ip_to_decimal(ip), lanmask)) ~= nixio.bit.band(ip_to_decimal(cfgip), cfgmask) then + if lanmask ~= cfgmask or decimal_to_ip(nixio.bit.band(ip_to_decimal(lanip), lanmask)) ~= nixio.bit.band(ip_to_decimal(cfgip), cfgmask) then subnet_change = true end end