Skip to content

fix: encoding of IPv6 addresses in impl From<SocketAddr> for Socket - #179

Merged
NobodyXu merged 1 commit into
openssh-rust:masterfrom
paolobarbolini:fix-ipv6
Dec 3, 2025
Merged

fix: encoding of IPv6 addresses in impl From<SocketAddr> for Socket#179
NobodyXu merged 1 commit into
openssh-rust:masterfrom
paolobarbolini:fix-ipv6

Conversation

@paolobarbolini

Copy link
Copy Markdown
Contributor

This makes the impl From<SocketAddr> for Socket<'static> implementation wrap IPv6 addresses in square brackets, so that an address like an address like 2606:4700:4700::1111 port 123 gets encoded as [2606:4700:4700::1111]:123 instead of 2606:4700:4700::1111:123 as it does now.

This is also what the std Display implementation for SocketAddr does: https://doc.rust-lang.org/1.91.1/src/core/net/socket_addr.rs.html#678

@jonhoo

jonhoo commented Dec 3, 2025

Copy link
Copy Markdown
Collaborator

This change is Reviewable

@codecov-commenter

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

❌ Patch coverage is 75.00000% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 81.53%. Comparing base (bacc76d) to head (190f190).
⚠️ Report is 23 commits behind head on master.

Files with missing lines Patch % Lines
src/port_forwarding.rs 75.00% 1 Missing ⚠️
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.
Additional details and impacted files
Files with missing lines Coverage Δ
src/port_forwarding.rs 54.83% <75.00%> (+0.29%) ⬆️

... and 14 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@NobodyXu NobodyXu left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thank you! Will cit a release now

@NobodyXu
NobodyXu merged commit 500e82b into openssh-rust:master Dec 3, 2025
12 checks passed
@github-actions github-actions Bot mentioned this pull request Dec 3, 2025
@paolobarbolini

Copy link
Copy Markdown
Contributor Author

That was quick! Thank you very much 😃

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

4 participants