Interfaces were returned in order defined in uci config, e.g.:
config device
option name 'br-lan'
list ports 'lan3'
list ports 'lan0'
list ports 'lan11'
list ports 'lan7'
list ports 'lan1'
Would return interfaces in order ['lan3', 'lan0', 'lan11', 'lan2', 'lan1']
instead of expected ['lan0', 'lan1', 'lan2' 'lan3', 'lan11']
.
It is possible to get to this state by moving interfaces between interfaces groups (wan, lan, guest), because newly added interface will be appended to the list in uci config file.
This commit will sort interfaces again by their names, before finalizing the json data.
Closes: #238 (closed)
Depends on: turris/turrishw!13 (merged)