[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

One socket per AF (Was: 6to4 using ::FFFF:0000:0000/96...)



Iljitsch van Beijnum wrote:
[..]
I can't say that I spend a lot of time writing applications, but I consider having a single interface to talk IPv4 and IPv6 extremely important.

Exactly because you don't write enough applications ;)

There is a single interface: BSD sockets.

getaddrinfo(), getnameinfo(), socket(), connect()/listen()/bind(), recv() & write().

Works for both IPv4 and IPv6, people just have to get used to using the select() function for using multiple sockets at the same time.

yes, that makes server-side programs (the ones that listen) a bit more difficult to write. Client programs stay the same, loop, try to connect and presto.

If you really want to solve the "I don't get this" problem, or the "I don't want to do this", use one of the many excellent libraries which wrap all around this. Maybe there is something that the IETF should do: publish a library which is in the public domain and AF and actually socket agnostic?

Without that, it's very easy to have bugs that only come up in one IP version and it is of course extra work to have two sets of socket calls.

It indeed is very easy to have bugs when you are mixing IPv4 and IPv6.
eg a 'firewall' which only checks the first 32bits of the address. Or what about the original subject, trying to send from IPv4 over IPv6 to IPv4, auto-translating A records into AAAA. Not even going to the RBL-code reversing only the first

Yes, IPv4-mapped/compat was a good idea, and using it correctly internally in an application is probably a good move. But using it on the wire or when presenting it to users is definitely not.

Worse, it's not possible to create IP version agnostic applications.

(There is a word which starts with the letter B, which is the male version of a cow and then ends in what it produces, not talking about milk here)

Please read:
http://www.kame.net/newsletter/19980604/
http://gsyc.escet.urjc.es/~eva/IPv6-web/ipv6.html

Note that the first document is nearly TEN (that is 10) years old already. The second one by Eva definitely should be able to let any programmer understand how easy it is to write a perfectly fine socket program.

Greets,
 Jeroen


Attachment: signature.asc
Description: OpenPGP digital signature