Skip to content

fix(IP) parsing ip addr with peer information#2546

Draft
SimonFair wants to merge 2 commits intounraid:masterfrom
SimonFair:fix(IP)-parsing-ip-addr-with-peer-information
Draft

fix(IP) parsing ip addr with peer information#2546
SimonFair wants to merge 2 commits intounraid:masterfrom
SimonFair:fix(IP)-parsing-ip-addr-with-peer-information

Conversation

@SimonFair
Copy link
Contributor

@SimonFair SimonFair commented Feb 19, 2026

#2544 is the original PR for 7.2 this will only be fixed in 7.3

Summary by CodeRabbit

  • Bug Fixes
    • Improved output formatting to strip peer address substrings and trim leading spaces, in addition to existing metric cleanup, so displayed metrics are cleaner and whitespace-normalized.

@github-actions
Copy link

github-actions bot commented Feb 19, 2026

🔧 PR Test Plugin Available

A test plugin has been generated for this PR that includes the modified files.

Version: 2026.02.19.1248
Build: View Workflow Run

📥 Installation Instructions:

Install via Unraid Web UI:

  1. Go to Plugins → Install Plugin
  2. Copy and paste this URL:
https://preview.dl.unraid.net/pr-plugins/pr-2546/webgui-pr-2546.plg
  1. Click Install

Alternative: Direct Download

⚠️ Important Notes:

  • Testing only: This plugin is for testing PR changes
  • Backup included: Original files are automatically backed up
  • Easy removal: Files are restored when plugin is removed
  • Conflicts: Remove this plugin before installing production updates

📝 Modified Files:

Click to expand file list
etc/rc.d/rc.library.source

🔄 To Remove:

Navigate to Plugins → Installed Plugins and remove webgui-pr-2546, or run:

plugin remove webgui-pr-2546

🤖 This comment is automatically generated and will be updated with each new push to this PR.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 19, 2026

No actionable comments were generated in the recent review. 🎉


Walkthrough

The show() function in the rc.library.source script is modified to remove peer address patterns from its output pipeline when processing two arguments, adding an additional sed substitution before whitespace trimming.

Changes

Cohort / File(s) Summary
Output Cleaning Enhancement
etc/rc.d/rc.library.source
Modified the show() function to include an extra sed substitution that removes peer addresses (matching peer x.x.x.x/x) alongside existing metric cleanup, with leading space trimming applied afterward.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Poem

🐰 Tidy whiskers, tidy code,
Peer addresses hit the road!
With sed's precision, swift and keen,
The cleanest output ever seen.
Leading spaces trimmed just right.

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: fixing IP address parsing when peer information is present in the output.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Comment @coderabbitai help to get the list of available commands and usage tips.

@SimonFair SimonFair added the 7.3 label Feb 19, 2026
Copy link
Contributor

@coderabbitai coderabbitai bot left a 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

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@etc/rc.d/rc.library.source`:
- Line 60: The sed token that strips " peer ..." currently only matches IPv4 and
uses unescaped dots; update the sed fragment in the pipeline that contains "s/
peer ...//g" so it accepts either an IPv4 dotted-quad (with dots escaped) or an
IPv6 address (hex digits and colons) followed by "/<prefix>" — use the existing
extended regex mode (sed -r) and an alternation grouping to match either address
form before the "/[0-9]+" prefix length, and keep the rest of the pipeline (the
ip -br addr show ... | awk ... | sed ...) unchanged.

@SimonFair SimonFair marked this pull request as draft February 19, 2026 12:42
@SimonFair SimonFair marked this pull request as draft February 19, 2026 12:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

Comments