diff options
author | Jo-Philipp Wich <jow@openwrt.org> | 2009-01-27 17:15:14 +0000 |
---|---|---|
committer | Jo-Philipp Wich <jow@openwrt.org> | 2009-01-27 17:15:14 +0000 |
commit | afd569dfcae999da3f241af4b9a226e2bd893e04 (patch) | |
tree | e0c50ebaaff346300334736475ca7be48e8cf0c7 | |
parent | a27c539deac41b583434564fbd0c2f8c5317b0f9 (diff) |
modules/admin-core: implement a more elegant solution for #46; treat empty or zero-length netmasks as /32 subnet
-rw-r--r-- | modules/admin-core/luasrc/tools/webadmin.lua | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/modules/admin-core/luasrc/tools/webadmin.lua b/modules/admin-core/luasrc/tools/webadmin.lua index 62168ebb7..0e09be980 100644 --- a/modules/admin-core/luasrc/tools/webadmin.lua +++ b/modules/admin-core/luasrc/tools/webadmin.lua @@ -66,7 +66,9 @@ function network_get_addresses(net) local mav4 = state:get("network", net, "netmask") local ipv6 = state:get("network", net, "ip6addr") - if ipv4 and mav4 and #ipv4 > 0 and #mav4 > 0 then + if ipv4 and #ipv4 > 0 then + if mav4 and #mav4 == 0 then mav4 = nil end + ipv4 = luci.ip.IPv4(ipv4, mav4) if ipv4 then |