Skip to content

fix: resolve set -u crash on unset QOS/PRIOR variables - #24

Merged
wickedyoda merged 1 commit into
masterfrom
fix/set-u-unset-vars
Sep 11, 2026
Merged

wickedyoda merged 1 commit into
masterfrom
fix/set-u-unset-vars

Conversation

@wickedyoda

Copy link
Copy Markdown
Owner

Fixes the crash:

/usr/local/sbin/glinet-vlan-qos-setup.sh: line 187: QOS_LAN_BW_UP: parameter not set

set -euo pipefail is active and get_config_value() used [ -n "$VAR" ] to test variables that may not be set (e.g. when running the wizard fresh without a previous config file). Changed to ${VAR:-} parameter expansion.

Also added IFB device skip in write_config() loop to match select_priority().

get_config_value() referenced variables like $QOS_LAN_BW_UP directly
in [ -n ] test, which fails with set -u when the variable is not set.
Changed to use ${VAR:-} parameter expansion.

Also added IFB device skip in write_config() loop to match select_priority.
Copilot AI lite review requested due to automatic review settings September 11, 2026 21:28

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The helper can still exit under set -e, and runtime QoS loops do not consistently exclude IFB interfaces.

Get a fresh assessment by requesting another Copilot review.

Pull request overview

This pull request updates the QoS setup wizard to handle unset variables and exclude IFB devices from generated configuration.

Changes:

  • Uses safe expansion for optional QoS and priority variables.
  • Skips IFB devices during configuration generation.
  • Updates the setup script checksum.
File summaries
File Summary
glinet-vlan-qos-setup.sh Adjusts unset-variable handling and IFB filtering.
checksums.txt Updates the setup script SHA-256 checksum.
Review details

Suppressed comments (1)

glinet-vlan-qos-setup.sh:220

  • This filters IFB interfaces only from the generated config; the runtime still enumerates every /sys/class/net/br-* in glinet-vlan-qos.sh's setup_nft() and WAN/bridge shaping loops, without the *-ifb guard. As a result, br-lan-ifb can still receive marks and qdiscs despite this comment saying it is not for QoS. Apply the same exclusion to those runtime loops or make them consume the filtered bridge-discovery result.
      # Skip IFB devices (e.g., br-lan-ifb) — they're for traffic mirroring, not QoS
      case "$br" in
        *-ifb) continue ;;
      esac
  • Files reviewed: 2/2 changed files
  • Comments generated: 1
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread glinet-vlan-qos-setup.sh
Comment on lines 199 to 201
*) ;;
esac
}
@wickedyoda
wickedyoda merged commit 72fd64a into master Sep 11, 2026
3 checks passed
@wickedyoda
wickedyoda deleted the fix/set-u-unset-vars branch September 11, 2026 21:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants