I've written a fair bit of code that binds to both Ipv4 and v6 for incoming connections, using two sockets (one for each.)
Perusing around the 'net I see an implementation note written by IBM that implies that on their Unix implementation you can set up an INET6 listener and it will open listeners on *both* IPv4 and v6; you code it as an Ipv6 socket/bind/listen/accept, and if an Ipv4 connection comes in you get a prefix'd IPv4 address back when you call getpeername(). This would obviously shorten up code and remove the need to open the second listener socket, but playing with this on FreeBSD it doesn't appear to work -- I only get the IPv6 listener in "netstat -a -n" showing up and as expected a connection to a v4 address on that port fails (refused, since there's no listener.) Is this something that *should* work on FreeBSD? Ref: https://www.ibm.com/support/knowledgecenter/en/ssw_i5_54/rzab6/xacceptboth.htm -- Karl Denninger k...@denninger.net <mailto:k...@denninger.net> /The Market Ticker/ /[S/MIME encrypted email preferred]/
smime.p7s
Description: S/MIME Cryptographic Signature