tohojo / sqm-scripts

SQM scripts traffic shaper
http://www.bufferbloat.net/projects/cerowrt/wiki/Smart_Queue_Management
234 stars 64 forks source link

openwrt/hotplug: Handle DSA switch port configs #164

Closed tohojo closed 1 year ago

tohojo commented 1 year ago

In the OpenWrt hotplug script we handle the case where the interface hotplug event arrives for the bridge interface by querying uci to find the underlying devices that are part of the bridge and restarting any configured SQM instances on the ports. However, with the switch to DSA, we can no longer find the bridge ports in the network.$INTERFACE.ifname property. Instead, we have to query the 'device' property and locate the separate device config section to find the port names.

Add a function to do this querying, but keep the ifname query to retain compatibility with old configs (it's harmless if the parameter is empty).

Fixes #163