IPv4->6 application shim library
Nick Sayer
nsayer@quack.kfu.com
Mon, 03 Dec 2001 22:16:12 -0800
It's come to the point now that, applications willing, it is possible to
configure a network without IPv4 and still experience the Internet fully
(you do this with the Trick-or-Treat DNS proxy and a NAT/PT gateway like
faith/faithd).
The only problem with this schema is that all of your applications have
to be aware of IPv4.
My idea is an LD_PRELOAD shim that will transparently "massage" IPv4 apps.
It replaces gethostbyname() and gethostbyaddr(). It looks for IPv6
addresses for the names presented and keeps a list in memory. It returns
a phony IPv4 address that can be used later to find the IPv6 host
desired. socket also gets intercepted and changes AF_INET to AF_?INET6,
and connect changes the ersatz IPv4 sockaddr into the real IPv6 one
before calling the real connect.
I'm writing to see if anyone has any comments on this idea, or perhaps
someone has already done this...?