The Aaronic answer, I'm afraid, is pretty wrong. Yes, user interface changes will be needed, but any code using traditional socket APIs will also likely require significant changes to support IPv6.
Most older codes use a specific address family constant ( AF_INET ) and a specific data structure ( struct sockaddr_in ). Any code that still uses this is actually stuck on IPv4 ground.
The new code should use modern API calls, such as getaddrinfo() , which is able to return the correct values for the protocol, address family (i.e. AF_INET6 ), addresses, etc., regardless of whether the remote host uses IPv4 or IPv6 (or both).
This is a bit long, but here is a sample code from the Linux man page for getaddrinfo . Pay attention to how the call receives the entire list of potential remote addresses and each time it tries:
memset(&hints, 0, sizeof(struct addrinfo)); hints.ai_family = AF_UNSPEC; hints.ai_socktype = SOCK_DGRAM; hints.ai_flags = 0; hints.ai_protocol = 0; s = getaddrinfo(hostname, service, &hints, &result); if (s != 0) { fprintf(stderr, "getaddrinfo: %s\n", gai_strerror(s)); exit(EXIT_FAILURE); } for (rp = result; rp != NULL; rp = rp->ai_next) { sfd = socket(rp->ai_family, rp->ai_socktype, rp->ai_protocol); if (sfd == -1) continue; if (connect(sfd, rp->ai_addr, rp->ai_addrlen) != -1) break; close(sfd); } if (rp == NULL) { fprintf(stderr, "Could not connect\n"); exit(EXIT_FAILURE); } freeaddrinfo(result);
source share