Feature: IPv6 and bind-address support #181

Closed
opened 2026-07-30 18:32:54 +02:00 by TapTap · 0 comments
Owner

Corresponding rsync flags/behavior:

  • --address=ADDRESS / --bind-address — bind the server to a specific interface or listen on a specific address
  • IPv6 literal host support (e.g., [::1]:8080 or user@host:/path with IPv6)

Current FastSync behavior:
src/shared/transport_tcp.c and transport_tls.c hardcode AF_INET and struct sockaddr_in. The server binds to INADDR_ANY on IPv4 only. The client uses inet_pton(AF_INET, host, ...) so IPv6 addresses and hostnames are rejected.

Proposed changes:

  • CLI flags: --bind-address=<ip> (server), --server-host already exists but should accept hostnames and IPv6 literals
  • Server changes:
    • Use getaddrinfo() with AI_PASSIVE to support both IPv4 and IPv6
    • Optionally create separate IPv4/IPv6 sockets or use IPV6_V6ONLY
    • Bind to the address specified by --bind-address
  • Client changes:
    • Use getaddrinfo() in client_connect() and client_connect_tls() to resolve hostnames and IPv6 literals
    • Parse [::1]:8080 style IPv6 endpoints if added later
  • Header changes: Server/Client structs should use struct sockaddr_storage

Priority: medium
Rationale: IPv6 is increasingly required in modern networks. Hostname resolution is also needed for any real deployment beyond localhost.

Acceptance criteria:

  • Server can listen on :: and accept IPv6 connections
  • Client can connect to --server-host ::1
  • Client can connect to --server-host myserver.example.com
  • Server --bind-address 127.0.0.1 only accepts IPv4 localhost connections
  • Existing IPv4 behavior is preserved by default
**Corresponding rsync flags/behavior:** - `--address=ADDRESS` / `--bind-address` — bind the server to a specific interface or listen on a specific address - IPv6 literal host support (e.g., `[::1]:8080` or `user@host:/path` with IPv6) **Current FastSync behavior:** `src/shared/transport_tcp.c` and `transport_tls.c` hardcode `AF_INET` and `struct sockaddr_in`. The server binds to `INADDR_ANY` on IPv4 only. The client uses `inet_pton(AF_INET, host, ...)` so IPv6 addresses and hostnames are rejected. **Proposed changes:** - CLI flags: `--bind-address=<ip>` (server), `--server-host` already exists but should accept hostnames and IPv6 literals - Server changes: - Use `getaddrinfo()` with `AI_PASSIVE` to support both IPv4 and IPv6 - Optionally create separate IPv4/IPv6 sockets or use `IPV6_V6ONLY` - Bind to the address specified by `--bind-address` - Client changes: - Use `getaddrinfo()` in `client_connect()` and `client_connect_tls()` to resolve hostnames and IPv6 literals - Parse `[::1]:8080` style IPv6 endpoints if added later - Header changes: `Server`/`Client` structs should use `struct sockaddr_storage` **Priority:** medium **Rationale:** IPv6 is increasingly required in modern networks. Hostname resolution is also needed for any real deployment beyond localhost. **Acceptance criteria:** - [ ] Server can listen on `::` and accept IPv6 connections - [ ] Client can connect to `--server-host ::1` - [ ] Client can connect to `--server-host myserver.example.com` - [ ] Server `--bind-address 127.0.0.1` only accepts IPv4 localhost connections - [ ] Existing IPv4 behavior is preserved by default
TapTap added the enhancementneeds-triage labels 2026-07-30 18:32:54 +02:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: TapTap/FastSync#181