Closed fzinken closed 2 months ago
Thx for the report, to be more precise, the bug is in the fact that the custom form permit to insert a list of mac split with a space. Luci detect only the list form. Should be an easy fix.
@fzinken had the time to test this and to my surprise I can't reproduce this. With your config the ui can correctly show the 2 mac. Can you confirm this?
@fzinken had the time to test this and to my surprise I can't reproduce this. With your config the ui can correctly show the 2 mac. Can you confirm this?
I am confused, you mean you can generate a double MAC entry with LUCI and it is correctly shown?
You mean this config LUCI generated
is working for you?
@fzinken Yes. Are you on master or on stable?
Are you on master or on stable?
Assume stable. luci - git-20.247.75781-0d0ab01-1
Assume stable. luci - git-20.247.75781-0d0ab01-1
Yep, 0d0ab01 is from stable 19.07 branch
I have the same issue.
OpenWrt 19.07.7 r11306-c4a6851c72 / LuCI openwrt-19.07 branch git-21.062.76689-a607f9c
1.) Entry with old option format do not display correctly
config host
option dns '1'
option name 'host'
option ip '192.168.255.253'
option mac 'xx:xx:xx:xx:xx:xx yy:yy:yy:yy:yy:yy'
option leasetime '7m'
host none 192.168.255.253 7m none none
2.) Change /etc/dhcp/config to use list format
config host
option dns '1'
option name 'host'
option ip '192.168.255.253'
list mac 'xx:xx:xx:xx:xx:xx'
list mac 'yy:yy:yy:yy:yy:yy'
option leasetime '7m'
Luci now shows:
host xx:xx:xx:xx:xx:xx 192.168.255.253 7m none none
yy:yy:yy:yy:yy:yy
3.) Create a static entry using Luci
- Luci only accept custom input of MAC, in the format of "mac1 mac2"
- after it is save, check /etc/config/dhcp, the entry in for old option format as in 1.) is created. Thus Luci will show the entry as "non" in MAC field once created.
IIUC
form.Value
should be replaced by a form.DynamicList
(example in wireless
).list(macaddr)
signifies a space-separated value, as opposed to a UCI list.DynamicList
be able to parse old configs, or is there a need for migration logic? I suspect L.toArray
is enough to handle both cases.toArray
in https://github.com/openwrt/luci/commit/6c9a6c334e2fa55f4b64b64b85e0b104f0b99037, but it didn't affect the write-side.Partially solved in https://github.com/openwrt/luci/commit/d5db17361a556f9c7eda8fa1a0b0c59d57034633
But when click Set Static
in Active DHCP Leases
on http://openwrt.lan/cgi-bin/luci/admin/status/overview
, luci still executes uci set dhcp.@host[-1].mac='xxx'
instead of uci add_list dhcp.@host[-1].mac='xxx'
@systemcrash Could you please update it?
Good catch! Should be fixed now, I think. See cef99564086caf0aa07dcd8753e0b505504687c1
Bug Description When entering a DHCP Static Lease with multiple MAC addresses LUCI adds it to
/etc/config/dhcp
in the old format.Example config
LUCI generated
New Format
LUCI also only show it correct if the new format is being used.
LUCI display after saving
LUCI display after manual correction