diff --git a/checksums.txt b/checksums.txt index 29a454d..bd0d565 100644 --- a/checksums.txt +++ b/checksums.txt @@ -1,2 +1,2 @@ -31eb2c54fa3b815e397261706d06d6755f41e26d09094b84175846a946b0e366 glinet-vlan-qos.sh -6923874031aaf63bfd46abdc9e0534f31e333c05998f1a2b9e8cd43bda7129f1 glinet-vlan-qos-setup.sh \ No newline at end of file +f3f9c3b78f3df03574a1f0a1e28a9bd5315f0c462437af162671cfddf20f2a38 glinet-vlan-qos.sh +77857db4cc80629f5897d1026764f51721de82c2b70c98b6f61693fc1a6b90c7 glinet-vlan-qos-setup.sh \ No newline at end of file diff --git a/glinet-vlan-qos-setup.sh b/glinet-vlan-qos-setup.sh index 1b603e5..0d91a2f 100755 --- a/glinet-vlan-qos-setup.sh +++ b/glinet-vlan-qos-setup.sh @@ -120,6 +120,10 @@ select_priority() { for br in /sys/class/net/br-*; do [ -d "$br" ] || continue br=$(basename "$br") + # Skip IFB devices (e.g., br-lan-ifb) — they're for traffic mirroring, not QoS + case "$br" in + *-ifb) continue ;; + esac discovered="$discovered $br" done # Add tailscale0 if present @@ -127,15 +131,13 @@ select_priority() { for b in $discovered; do read -p "Priority for $b (1-3, 0 to skip): " -r pri - local config_name - # Convert bridge name to config variable suffix (e.g., br-lan -> LAN) case "$b" in br-lan|lan) config_name="LAN" ;; br-iot|iot) config_name="IOT" ;; br-guest|guest) config_name="GUEST" ;; tailscale0|tailscale) config_name="TAILSCALE" ;; - br-*) config_name=$(echo "$b" | sed 's/br-//' | tr '[:lower:]' '[:upper:]') ;; - *) config_name=$(echo "$b" | tr '[:lower:]' '[:upper:]') ;; + br-*) config_name=$(echo "$b" | sed 's/br-//' | tr '[:lower:]' '[:upper:]' | tr '-' '_') ;; + *) config_name=$(echo "$b" | tr '[:lower:]' '[:upper:]' | tr '-' '_') ;; esac case "$pri" in @@ -218,8 +220,8 @@ write_config() { br-iot|iot) config_name="IOT" ;; br-guest|guest) config_name="GUEST" ;; tailscale0|tailscale) config_name="TAILSCALE" ;; - br-*) config_name=$(echo "$br" | sed 's/br-//' | tr '[:lower:]' '[:upper:]') ;; - *) config_name=$(echo "$br" | tr '[:lower:]' '[:upper:]') ;; + br-*) config_name=$(echo "$br" | sed 's/br-//' | tr '[:lower:]' '[:upper:]' | tr '-' '_') ;; + *) config_name=$(echo "$br" | tr '[:lower:]' '[:upper:]' | tr '-' '_') ;; esac # Use stored bandwidth if available, otherwise default diff --git a/glinet-vlan-qos.sh b/glinet-vlan-qos.sh index 10fd737..296af42 100755 --- a/glinet-vlan-qos.sh +++ b/glinet-vlan-qos.sh @@ -114,6 +114,10 @@ discover_bridges() { for br in /sys/class/net/br-*; do [ -d "$br" ] || continue br=$(basename "$br") + # Skip IFB devices (e.g., br-lan-ifb) — they're for traffic mirroring, not QoS + case "$br" in + *-ifb) continue ;; + esac idx=$((idx + 1)) local mark=$((16 + (idx - 1) * 16)) # 0x10, 0x20, 0x30, ... echo "${br} ${mark}" @@ -186,8 +190,8 @@ get_bw_config() { br-iot|iot) config_name="IOT" ;; br-guest|guest) config_name="GUEST" ;; tailscale0|tailscale) config_name="TAILSCALE" ;; - br-*) config_name=$(echo "$br" | sed 's/br-//' | tr '[:lower:]' '[:upper:]') ;; - *) config_name=$(echo "$br" | tr '[:lower:]' '[:upper:]') ;; + br-*) config_name=$(echo "$br" | sed 's/br-//' | tr '[:lower:]' '[:upper:]' | tr '-' '_') ;; + *) config_name=$(echo "$br" | tr '[:lower:]' '[:upper:]' | tr '-' '_') ;; esac eval "up_bw=\${QOS_${config_name}_BW_UP:-}"