3 ms·
For majority of applications, supporting IPv6 boils down to using getaddrinfo()/getnameinfo() instead of gethostbyname()/gethostbyaddr(), which results in code
by dfox 10y ago
For majority of applications, supporting IPv6 boils down to using getaddrinfo()/getnameinfo() instead of gethostbyname()/gethostbyaddr(), which results in code that supports both IPv4 and IPv6 and is simpler than the IPv4-only original.
- rwmj 10y agoThe catch is you also have to be prepared to listen on multiple sockets. There are lots of servers out there which get this wrong, including qemu-nbd. For reference here's my implementation of this which (I think) gets it right: https://github.com/libguestfs/nbdkit/blob/master/src/sockets.c#L105 https://github.com/libguestfs/nbdkit/blob/master/src/sockets...
- mvkg 10y agoA good dual-stack implementation should also support Happy Eyeballs which does not result in simpler code.