Skip to content

Commit

Permalink
luci-mod-network: made expandAndFormatMAC return arrays
Browse files Browse the repository at this point in the history
instead of returning a space separated string

follow-up to 5ab0cb1

Closes openwrt#7209

Signed-off-by: Paul Donald <[email protected]>
  • Loading branch information
systemcrash committed Jul 25, 2024
1 parent 5ab0cb1 commit 84ffb65
Showing 1 changed file with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ function expandAndFormatMAC(macs) {
}
});

return result.length ? result.join(' ') : null;
return result.length ? result : null;
}

function isValidMAC(sid, s) {
Expand Down Expand Up @@ -1039,8 +1039,12 @@ return view.extend({
//As a special case, in DHCPv4, it is possible to include more than one hardware address. eg: --dhcp-host=11:22:33:44:55:66,12:34:56:78:90:12,192.168.0.2 This allows an IP address to be associated with multiple hardware addresses, and gives dnsmasq permission to abandon a DHCP lease to one of the hardware addresses when another one asks for a lease
so.rmempty = true;
so.cfgvalue = function(section) {
var macs = L.toArray(uci.get('dhcp', section, 'mac'));
return expandAndFormatMAC(macs);
var macs = uci.get('dhcp', section, 'mac');
if(!Array.isArray(macs)){
return expandAndFormatMAC(L.toArray(macs));
} else {
return expandAndFormatMAC(macs);
}
};
//removed jows renderwidget function which hindered multi-mac entry
so.validate = validateMACAddr.bind(so, pools);
Expand Down

0 comments on commit 84ffb65

Please sign in to comment.