Skip to content

Commit 94f8d1a

Browse files
committed
common: nameif: Handle nested dsa ports
In setups like this... CPU eth0 | .----0----. | dst0sw0 | '-1-2-3-4-' | .----0----. | dst1sw0 | '-1-2-3-4-' ...both eth0 and dst0sw0p4 are DSA ports. But the latter is _also_ a physical port as far as devlink is concerned. As a result, it would first be marked as "internal" and is then instantly reclassified as a "port". Catch this condition and stick with the initial "internal" classification.
1 parent 39b4101 commit 94f8d1a

File tree

1 file changed

+6
-0
lines changed
  • board/common/rootfs/usr/libexec/infix/init.d

1 file changed

+6
-0
lines changed

board/common/rootfs/usr/libexec/infix/init.d/20-nameif

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,12 @@ ports=$(devlink -j port | jq -r '.port[]
3434
| select(.flavour == "physical")
3535
| .netdev')
3636
for iface in $ports; do
37+
# On systems with multiple switch trees, a port may be _both_
38+
# a physical port, registered with devlink, _and_ a DSA
39+
# port. In those cases, hold on to our initial "internal"
40+
# classification.
41+
[ $(ip -j link show dev "$iface" | jq -r '.[0].group') = internal ] && continue
42+
3743
ip link set "$iface" group port
3844
done
3945

0 commit comments

Comments
 (0)