From ceec7a6fa53b7e5449db4bde87fcd8d05999e6ec Mon Sep 17 00:00:00 2001 From: Tim Wilkinson Date: Sun, 6 Mar 2022 16:15:07 -0800 Subject: [PATCH] Fix mis-reporting of changed LAN subnet on reboot (#268) --- files/www/cgi-bin/advancedconfig | 2 +- files/www/cgi-bin/setup | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/files/www/cgi-bin/advancedconfig b/files/www/cgi-bin/advancedconfig index f91d50db..bd600335 100755 --- a/files/www/cgi-bin/advancedconfig +++ b/files/www/cgi-bin/advancedconfig @@ -297,7 +297,7 @@ function reboot() lanmask = ip_to_decimal(lanmask) 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(lanip), lanmask)) ~= nixio.bit.band(ip_to_decimal(cfgip), cfgmask) then + 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 end diff --git a/files/www/cgi-bin/setup b/files/www/cgi-bin/setup index 9d3797f1..cf618505 100755 --- a/files/www/cgi-bin/setup +++ b/files/www/cgi-bin/setup @@ -152,7 +152,7 @@ function reboot() lanmask = ip_to_decimal(lanmask) 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(lanip), lanmask)) ~= nixio.bit.band(ip_to_decimal(cfgip), cfgmask) then + 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 end