luci-base: fix table compare upon writing ipaddr changes
authorJo-Philipp Wich <jo@mein.io>
Thu, 13 Dec 2018 11:14:37 +0000 (12:14 +0100)
committerJo-Philipp Wich <jo@mein.io>
Thu, 13 Dec 2018 11:14:37 +0000 (12:14 +0100)
Fixes: b33192a03 ("luci-base: support cidr list notation for option ipaddr and ip6addr")
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
modules/luci-base/luasrc/model/cbi/admin_network/proto_static.lua

index 3c5751744a39e8b7f5843e80f7fc8c874561c505..246d2c0ed5ce0f7a86e0f2e640db9d2d8de2e8c0 100644 (file)
@@ -34,7 +34,7 @@ usecidr.write = function(self, section)
        local formvalue = (self:formvalue(section) == "1") and ipaddr_multi:formvalue(section) or ipaddr_single:formvalue(section)
        local equal = (cfgvalue == formvalue)
 
-       if not equal and type(cfgvalue) == "table" and type(formvalue) == "table" then
+       if not equal and type(cfgvalue) == "table" and type(formvalue) == "table" and #cfgvalue == #formvalue then
                equal = true
 
                local _, v