Skip to content

netowrk: utils.sh: add stricter bridge device section parsing

Jakob Olsson requested to merge jo-net-utils-fix into release-6.5

Previous parsing breaks with the addition of 8021q interfaces, as necessary by VLAN segregation. In such cases, subinterfaces are created, including name=br-lan.${vid}. With multiple hits, the remaining parsing of network/utils.sh breaks.

network.guest20_8021q.name='br-lan.20'

Old handling:

root@eagle-44d43771b930:/# uci show network | grep name=.*br-lan | cut -d'.' -f2
br_lan
guest20_8021q
guest20_8021q

New handling:

root@eagle-44d43771b930:/# uci show network | grep -w "name='.*br-lan'" | cut -d
'.' -f2
br_lan

This prevents proper backhaul swapping when VLANs are enabled, and loops may occur.

To my knowledge, this only affects devices with a dedicated WAN port (i.e. eagle).

Another option is to introduce a loop after reading all hits, but this seemed like a safer/smaller change to me.

Edited by Jakob Olsson

Merge request reports