Skip to content

fix: accept bracketed IPv6 host literals (#251) - #253

Merged
inureyes merged 3 commits into
mainfrom
fix/issue-251-ipv6-host-literals
Aug 2, 2026
Merged

fix: accept bracketed IPv6 host literals (#251)#253
inureyes merged 3 commits into
mainfrom
fix/issue-251-ipv6-host-literals

Conversation

@inureyes

@inureyes inureyes commented Aug 2, 2026

Copy link
Copy Markdown
Member

Summary

Accept bracketed IPv6 address literals in hostlist expressions and preserve their host, user, and port boundaries through CLI and YAML node resolution.

What changed

  • Disambiguate bracket groups by parsing their full contents as IPv6, while preserving numeric hostlist ranges such as node[1-3].
  • Normalize bracketed IPv6 hosts before resolver calls and reject bare literals with bracket-specific guidance.
  • Apply the same parsing rules to -H, SSH-style destinations, and simple or detailed cluster node entries.
  • Document accepted IPv6 forms and the disambiguation rule in CLI help and the bssh man page.
  • Add parser, expander, node, config, and real resolve_nodes regression coverage.

Test plan

  • cargo test --lib ipv6 (18 passed)
  • cargo test --lib hostlist::expander::tests::test_expand_simple_range (1 passed)
  • cargo test --bin bssh ipv6_tests (6 passed)
  • cargo check --lib --tests
  • cargo clippy --lib --tests -- -D warnings

Closes #251

Teach hostlist parsing to treat bracket groups as IPv6 only when the full contents parse as a valid IPv6 address, so numeric hostlist ranges keep their existing meaning while bracketed IPv6 literals pass through untouched.

Normalize bracketed IPv6 handling through the CLI destination parser, node parsing, and YAML cluster resolution so user, host, and port components stay consistent across command-line and config-driven entry points. Bare IPv6 literals now fail with guidance to use brackets because an unbracketed trailing segment cannot be distinguished from a port.

Document the bracket requirement in the CLI help and man page, and add focused parser, expander, node, config, and end-to-end resolution tests that cover accepted bracketed forms and the new rejection guidance.

Refs #251
@inureyes inureyes added type:bug Something isn't working priority:medium Medium priority issue status:review Under review labels Aug 2, 2026
SSH compatibility mode was using the optional destination parser, which dropped parser errors and turned an unbracketed IPv6 literal such as ::1 into a generic invalid destination message. Use the error-preserving parser in node resolution so SSH-style destinations follow the same bracket guidance as -H, and cover bracketed ssh:// plus bare literal cases through the real resolver flow.

Validation: cargo test --bin bssh ipv6_tests
@inureyes inureyes added status:done Completed and removed status:review Under review labels Aug 2, 2026
@inureyes
inureyes merged commit 0bfaa21 into main Aug 2, 2026
3 checks passed
@inureyes
inureyes deleted the fix/issue-251-ipv6-host-literals branch August 2, 2026 15:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

priority:medium Medium priority issue status:done Completed type:bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix: IPv6 address literals are unusable with -H, rejected by the hostlist expander

1 participant