summaryrefslogtreecommitdiffhomepage
path: root/modules/luci-mod-admin-full/luasrc/model
diff options
context:
space:
mode:
authorJo-Philipp Wich <jo@mein.io>2018-05-02 16:52:37 +0200
committerJo-Philipp Wich <jo@mein.io>2018-05-02 16:55:22 +0200
commit9adbd79faa8b2d50e92bd2fd6bc21aabe396591f (patch)
tree53fef19d0e74ec1602fdb08824394c32c5245513 /modules/luci-mod-admin-full/luasrc/model
parent8335997df5e103a9a8d9f06f0b514e809fb729b7 (diff)
luci-mod-admin-full: canonicalize configured static lease MAC
When reading the configured mac address of the static lease, filter it through luci.ip.checkmac() to canonicalize and uppercase the value for mapping it against the combo box host hints. Fixes #1772. Signed-off-by: Jo-Philipp Wich <jo@mein.io>
Diffstat (limited to 'modules/luci-mod-admin-full/luasrc/model')
-rw-r--r--modules/luci-mod-admin-full/luasrc/model/cbi/admin_network/dhcp.lua5
1 files changed, 5 insertions, 0 deletions
diff --git a/modules/luci-mod-admin-full/luasrc/model/cbi/admin_network/dhcp.lua b/modules/luci-mod-admin-full/luasrc/model/cbi/admin_network/dhcp.lua
index fbde431df8..3b030143e4 100644
--- a/modules/luci-mod-admin-full/luasrc/model/cbi/admin_network/dhcp.lua
+++ b/modules/luci-mod-admin-full/luasrc/model/cbi/admin_network/dhcp.lua
@@ -297,6 +297,11 @@ mac = s:option(Value, "mac", translate("<abbr title=\"Media Access Control\">MAC
mac.datatype = "list(macaddr)"
mac.rmempty = true
+function mac.cfgvalue(self, section)
+ local val = Value.cfgvalue(self, section)
+ return ipc.checkmac(val) or val
+end
+
ip = s:option(Value, "ip", translate("<abbr title=\"Internet Protocol Version 4\">IPv4</abbr>-Address"))
ip.datatype = "or(ip4addr,'ignore')"