luci-mod-status: optional MAC for static lease

Note that we might not have a MAC address to set in case of a DHCPv6
lease when the DUID is of a type which isn't MAC-based.

Signed-off-by: David Härdeman <david@hardeman.nu>
This commit is contained in:
David Härdeman
2025-11-17 19:07:59 +01:00
committed by Paul Donald
parent a345e036c1
commit 4a651d591b

View File

@@ -69,7 +69,8 @@ return baseclass.extend({
uci.set('dhcp', cfg, 'name', lease.hostname);
uci.set('dhcp', cfg, 'duid', [duid_iaid]);
uci.set('dhcp', cfg, 'mac', [lease.macaddr]);
if (lease.macaddr)
uci.set('dhcp', cfg, 'mac', [lease.macaddr.toUpperCase()]);
if (ip6arr)
uci.set('dhcp', cfg, 'hostid', (ip6arr[6] * 0xFFFF + ip6arr[7]).toString(16));