-
Notifications
You must be signed in to change notification settings - Fork 87
fix(INET): fix ip v6 dns issue with ending :: #2530
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
WalkthroughReworks the Changes
Sequence Diagram(s)(omitted — change is localized and does not introduce multi-component control flow requiring a sequence diagram) Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In `@etc/rc.d/rc.inet1.conf`:
- Around line 35-39: The change to unzero6() broke mid-address `::` handling by
adding an extra colon when `M` already contained ":" during the loop; revert the
loop to the original logic that iterates over ${A//:/ } and prints either "$M%x"
for non-"-" segments or "$M:" for "-" placeholders (using variables A, M, Q),
and then after the loop append an extra ":" only when the original input ends
with "::" (detectable from the original parameter or A) so addresses ending with
"::" keep the trailing double colon without producing ":::" in middle positions.
🔧 PR Test Plugin AvailableA test plugin has been generated for this PR that includes the modified files. Version: 📥 Installation Instructions:Install via Unraid Web UI:
Alternative: Direct Download
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In `@etc/rc.d/rc.inet1.conf`:
- Line 47: unzero6 can return 1 on invalid hex components but none of its
callers check this, causing silent failures; update every call site of unzero6
(the IPv6 address configuration handling, the DNS server entry processing, the
route configuration logic, and the rc.wireless setup calls) to test its return
status, and on non‑zero either log an error and abort the higher‑level operation
(return failure) or skip the malformed entry rather than using the empty output
— ensure you reference the unzero6 invocation and the variable capturing its
output in each caller and early‑exit or continue appropriately to avoid feeding
empty strings into downstream commands.
| for Q in ${A//:/ }; do | ||
| if [[ $Q != - ]]; then | ||
| # Validate hex (1-4 digits) | ||
| [[ $Q =~ ^[0-9A-Fa-f]{1,4}$ ]] || return 1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🏁 Script executed:
# Search for the function and its usages
rg -n -C3 'unzero6' etc/rc.d/rc.inet1.confRepository: unraid/webgui
Length of output: 200
🏁 Script executed:
# Also search for unzero6 calls throughout the codebase
rg -n 'unzero6' --type shRepository: unraid/webgui
Length of output: 39
🏁 Script executed:
# Get more context around line 47 in the file
sed -n '30,70p' etc/rc.d/rc.inet1.conf | cat -nRepository: unraid/webgui
Length of output: 1365
🏁 Script executed:
# Search for calls to unzero6 anywhere in the codebase
rg -n 'unzero6' -A 2 -B 2Repository: unraid/webgui
Length of output: 2421
🏁 Script executed:
# Also search for patterns that might invoke unzero6
rg -n '\$\(.*unzero6' -A 2 -B 2Repository: unraid/webgui
Length of output: 1979
🏁 Script executed:
# Get more context around each call site to verify error handling
sed -n '410,415p' etc/rc.d/rc.inet1 | cat -nRepository: unraid/webgui
Length of output: 459
🏁 Script executed:
sed -n '505,515p' etc/rc.d/rc.inet1 | cat -nRepository: unraid/webgui
Length of output: 878
🏁 Script executed:
sed -n '645,650p' etc/rc.d/rc.inet1 | cat -nRepository: unraid/webgui
Length of output: 360
Add error checking at all call sites for the return value of unzero6.
The function returns 1 when encountering invalid hex components. Currently, none of the 7 callers check this return value, resulting in silent failures when processing malformed IPv6 addresses:
- IPv6 address configuration (line 413)
- DNS server entries (lines 510-513)
- Route configuration (lines 647-648)
- Wireless interface setup (rc.wireless:157)
When unzero6 fails, it outputs nothing, leaving downstream commands with empty or incomplete strings that fail silently.
🤖 Prompt for AI Agents
In `@etc/rc.d/rc.inet1.conf` at line 47, unzero6 can return 1 on invalid hex
components but none of its callers check this, causing silent failures; update
every call site of unzero6 (the IPv6 address configuration handling, the DNS
server entry processing, the route configuration logic, and the rc.wireless
setup calls) to test its return status, and on non‑zero either log an error and
abort the higher‑level operation (return failure) or skip the malformed entry
rather than using the empty output — ensure you reference the unzero6 invocation
and the variable capturing its output in each caller and early‑exit or continue
appropriately to avoid feeding empty strings into downstream commands.
Summary by CodeRabbit
Refactor
Bug Fixes
✏️ Tip: You can customize this high-level summary in your review settings.