fix: support SOCKS5 IPv6 literal destinations - #261
Merged
Conversation
inureyes
force-pushed
the
fix/issue-256-socks-ipv6-literals
branch
from
August 3, 2026 11:12
9d54838 to
75f549e
Compare
Implement the SOCKS5 ATYP 0x04 path so dynamic forwarding consumes the full IPv6 request, formats the destination as [ipv6]:port, and reuses the existing family-aware direct-tcpip channel opener instead of rejecting IPv6 literals outright. Document the deliberate RFC 1928 reply choice to keep the OpenSSH-compatible 0.0.0.0:0 BND.ADDR placeholder, and update the CLI help and man page so they describe SOCKS5 IPv4, domain-name, and IPv6 literal support accurately. Validation: CARGO_TARGET_DIR=/home/inureyes/Development/backend.ai/bssh/target cargo check --lib; CARGO_TARGET_DIR=/home/inureyes/Development/backend.ai/bssh/target cargo test --test socks_ipv6_literal_test; CARGO_TARGET_DIR=/home/inureyes/Development/backend.ai/bssh/target cargo test --test address_family_test forced_family_with_no_candidate_fails_hard; CARGO_TARGET_DIR=/home/inureyes/Development/backend.ai/bssh/target cargo clippy --test socks_ipv6_literal_test -- -D warnings. Refs #256
Import TunnelStats directly into the SOCKS unit-test module so the cold test build resolves the helper type correctly. Also correct the synthetic SOCKS5 CONNECT request headers in the in-file tests so the handler sees the intended ATYP byte instead of an extra zero that forced the address-type-not-supported path. Validation: CARGO_TARGET_DIR=/tmp/bssh-256-libtests2-iA5MEz cargo test --lib forwarding::dynamic::socks::tests; CARGO_TARGET_DIR=/tmp/bssh-256-int2-CMiDkA cargo test --test socks_ipv6_literal_test; CARGO_TARGET_DIR=/tmp/bssh-256-check2-DPHEcE cargo check --lib --tests; CARGO_TARGET_DIR=/tmp/bssh-256-clippy-Y6LW6I cargo clippy --lib --tests -- -D warnings.
inureyes
force-pushed
the
fix/issue-256-socks-ipv6-literals
branch
from
August 3, 2026 11:43
7a85ad1 to
74311c4
Compare
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.
Summary
Test plan
CARGO_TARGET_DIR=/home/inureyes/Development/backend.ai/bssh/target cargo check --libCARGO_TARGET_DIR=/home/inureyes/Development/backend.ai/bssh/target cargo test --test socks_ipv6_literal_testCARGO_TARGET_DIR=/home/inureyes/Development/backend.ai/bssh/target cargo test --test address_family_test forced_family_with_no_candidate_fails_hardCARGO_TARGET_DIR=/home/inureyes/Development/backend.ai/bssh/target cargo clippy --test socks_ipv6_literal_test -- -D warningsNotes
cargo check --lib --testsis still blocked by pre-existingcfg(test)compile errors insrc/ssh/tokio_client/to_socket_addrs_with_hostname.rs; this branch does not touch that file.Closes #256