summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorJo-Philipp Wich <jo@mein.io>2020-10-08 19:28:16 +0200
committerGitHub <noreply@github.com>2020-10-08 19:28:16 +0200
commita805a3178f902fe609d3d4a6c7b6b5b1dad88838 (patch)
tree26366123b348183abc9233959bfa42492e680c59
parentd4901f34845440766f089797289fe294785e588b (diff)
parent6c9a6c334e2fa55f4b64b64b85e0b104f0b99037 (diff)
Merge pull request #4501 from Ansuel/fix-lease
luci-mod-network: handle multiple mac for static lease
-rw-r--r--modules/luci-mod-network/htdocs/luci-static/resources/view/network/dhcp.js5
1 files changed, 1 insertions, 4 deletions
diff --git a/modules/luci-mod-network/htdocs/luci-static/resources/view/network/dhcp.js b/modules/luci-mod-network/htdocs/luci-static/resources/view/network/dhcp.js
index 37cc29f32..7f46740da 100644
--- a/modules/luci-mod-network/htdocs/luci-static/resources/view/network/dhcp.js
+++ b/modules/luci-mod-network/htdocs/luci-static/resources/view/network/dhcp.js
@@ -432,12 +432,9 @@ return view.extend({
so.datatype = 'list(unique(macaddr))';
so.rmempty = true;
so.cfgvalue = function(section) {
- var macs = uci.get('dhcp', section, 'mac'),
+ var macs = L.toArray(uci.get('dhcp', section, 'mac')),
result = [];
- if (!Array.isArray(macs))
- macs = (macs != null && macs != '') ? macs.split(/\ss+/) : [];
-
for (var i = 0, mac; (mac = macs[i]) != null; i++)
if (/^([0-9a-fA-F]{1,2}):([0-9a-fA-F]{1,2}):([0-9a-fA-F]{1,2}):([0-9a-fA-F]{1,2}):([0-9a-fA-F]{1,2}):([0-9a-fA-F]{1,2})$/.test(mac))
result.push('%02X:%02X:%02X:%02X:%02X:%02X'.format(