Repository navigation
fix: resolve set -u crash on unset QOS/PRIOR variables - #24
Merged
Merged
Conversation
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.
There was a problem hiding this comment.
🟡 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-*inglinet-vlan-qos.sh'ssetup_nft()and WAN/bridge shaping loops, without the*-ifbguard. As a result,br-lan-ifbcan 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 on lines
199
to
201
| *) ;; | ||
| esac | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes the crash:
set -euo pipefailis active andget_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 matchselect_priority().