Feature: IPv6 and bind-address support #181
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Corresponding rsync flags/behavior:
--address=ADDRESS/--bind-address— bind the server to a specific interface or listen on a specific address[::1]:8080oruser@host:/pathwith IPv6)Current FastSync behavior:
src/shared/transport_tcp.candtransport_tls.chardcodeAF_INETandstruct sockaddr_in. The server binds toINADDR_ANYon IPv4 only. The client usesinet_pton(AF_INET, host, ...)so IPv6 addresses and hostnames are rejected.Proposed changes:
--bind-address=<ip>(server),--server-hostalready exists but should accept hostnames and IPv6 literalsgetaddrinfo()withAI_PASSIVEto support both IPv4 and IPv6IPV6_V6ONLY--bind-addressgetaddrinfo()inclient_connect()andclient_connect_tls()to resolve hostnames and IPv6 literals[::1]:8080style IPv6 endpoints if added laterServer/Clientstructs should usestruct sockaddr_storagePriority: medium
Rationale: IPv6 is increasingly required in modern networks. Hostname resolution is also needed for any real deployment beyond localhost.
Acceptance criteria:
::and accept IPv6 connections--server-host ::1--server-host myserver.example.com--bind-address 127.0.0.1only accepts IPv4 localhost connections