Comment by tonymet
4 days ago
Dual stack is a hack and binding to an interface like localhost or a single interface does not support dual stack . So your L6 code has to be modified and re tested to support L3 changes .
Even if ipv6 was just as simple , the cost of rebuild , retest and re-deploy is enough of a barrier against migration
Dual stack is a natural part of migrating between two protocols, because it's the most compatible way of handling both of them. You don't need to use dual stack to use both v4 and v6, but you'll probably choose to the instant you hit even the most minor incompatibility.
Your L6 code should work perfectly fine if you wrote it properly in the first place. If you pass "localhost" to getaddrinfo() with flags=AI_PASSIVE, it returns a list of socket addresses to listen on, and all you need to do is pass those to socket(). You don't need to look inside the sockaddrs and they might as well be opaque data to you, so it doesn't matter what L3 protocol they represent.
Most listeners I’ve seen assume a single FD. It’s IPv6 snobbery to say “you should have written your code to expect IPv6 upgrade 20 years ago”