enhancement: TCP transport only supports IPv4, no IPv6 support #33

Closed
opened 2026-07-20 14:57:51 +02:00 by TapTap · 0 comments
Owner

The TCP transport in src/shared/transport_tcp.c hard-codes IPv4 throughout:

Line 21: socket(AF_INET, SOCK_STREAM, 0) — creates IPv4-only sockets
Line 37: server->address.sin_addr.s_addr = INADDR_ANY — binds to IPv4 wildcard
Line 137: inet_pton(AF_INET, host, &client->address.sin_addr) — only parses IPv4 addresses

This means:

  • Server cannot listen on IPv6 addresses
  • Client cannot connect to IPv6 hosts
  • Dual-stack (IPv4+IPv6) not supported
  • In IPv6-only environments, the tool is completely non-functional

Suggested Fix: Use getaddrinfo() with AF_UNSPEC for both client and server to support both address families, or provide an --ipv4/--ipv6 option.

Location: src/shared/transport_tcp.c:21,37,137

Severity: medium

The TCP transport in `src/shared/transport_tcp.c` hard-codes IPv4 throughout: **Line 21:** `socket(AF_INET, SOCK_STREAM, 0)` — creates IPv4-only sockets **Line 37:** `server->address.sin_addr.s_addr = INADDR_ANY` — binds to IPv4 wildcard **Line 137:** `inet_pton(AF_INET, host, &client->address.sin_addr)` — only parses IPv4 addresses This means: - Server cannot listen on IPv6 addresses - Client cannot connect to IPv6 hosts - Dual-stack (IPv4+IPv6) not supported - In IPv6-only environments, the tool is completely non-functional **Suggested Fix:** Use `getaddrinfo()` with `AF_UNSPEC` for both client and server to support both address families, or provide an `--ipv4`/`--ipv6` option. **Location:** `src/shared/transport_tcp.c:21,37,137` **Severity:** medium
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: TapTap/FastSync#33