Skip to content

fix: active mode uses EPRT for IPv6 connections#145

Merged
veeso merged 2 commits into
mainfrom
fix/ipv6-port-command
Feb 12, 2026
Merged

fix: active mode uses EPRT for IPv6 connections#145
veeso merged 2 commits into
mainfrom
fix/ipv6-port-command

Conversation

@veeso

@veeso veeso commented Feb 12, 2026

Copy link
Copy Markdown
Owner

Summary

  • Use EPRT command instead of PORT when the local address is IPv6, since PORT only supports IPv4
  • Replace local_addr().unwrap() with proper error handling returning FtpError::ConnectionError
  • Applied to all three implementations: sync, tokio, and async-std

Severity

Medium — Active mode transfers over IPv6 would always fail with a malformed PORT command. Additionally, local_addr().unwrap() could panic.

Test plan

  • cargo build compiles without errors across all feature combinations
  • Verify EPRT is used for IPv6 and PORT for IPv4 in active mode

🤖 Generated with Claude Code

The PORT command only supports IPv4. When connected via IPv6, the client
now uses EPRT instead. Also replaces unwrap() on local_addr() with
proper error handling.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@veeso veeso added the gleam-gftp This issue affects also gleam-ftp library label Feb 12, 2026
@cocogitto-bot

cocogitto-bot Bot commented Feb 12, 2026

Copy link
Copy Markdown

✔️ d01e8d4...2a12a7e - Conventional commits check succeeded.

@veeso veeso merged commit f4010bf into main Feb 12, 2026
30 of 32 checks passed
@veeso veeso deleted the fix/ipv6-port-command branch February 12, 2026 16:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gleam-gftp This issue affects also gleam-ftp library

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant