Sort interfaces in their groups (lan, guest, ...) by slot name
Description
Interfaces in interfaces groups (wan, lan, guest) are not sorted before passing them out into result JSON.
For yet undiscovered reason, it seems that the order is determined by list ifname
order in /etc/config/network
.
We should sort interfaces in interfaces groups (lan, guest) by slot name to ensure nice ordered interface listing.
It is reproducible on Omnia, both TOS 6.0 and TOS 5.3.9.
Actual behavior
/etc/config/network
config interface 'lan'
[...]
list ifname 'lan3'
list ifname 'lan0'
list ifname 'lan1'
list ifname 'lan4'
list ifname 'lan2'
Returns interfaces in order given by uci config list
:
lan3 lan0 lan1 lan4 lan2
(Also seen in reForis)
Expected behavior
Return interfaces sorted, regardless of order in uci config list
:
lan0 lan1 lan2 lan3 lan4