1*00b67f09SDavid van MoolenbroekCopyright (C) 2004 Internet Systems Consortium, Inc. ("ISC") 2*00b67f09SDavid van MoolenbroekCopyright (C) 2000, 2001 Internet Software Consortium. 3*00b67f09SDavid van MoolenbroekSee COPYRIGHT in the source root or http://isc.org/copyright.html for terms. 4*00b67f09SDavid van Moolenbroek 5*00b67f09SDavid van MoolenbroekCurrently, there are multiple interesting problems with ipv6 6*00b67f09SDavid van Moolenbroekimplementations on various platforms. These problems range from not 7*00b67f09SDavid van Moolenbroekbeing able to use ipv6 with bind9 (or in particular the ISC socket 8*00b67f09SDavid van Moolenbroeklibrary, contained in libisc) to listen-on lists not being respected, 9*00b67f09SDavid van Moolenbroekto strange warnings but seemingly correct behavior of named. 10*00b67f09SDavid van Moolenbroek 11*00b67f09SDavid van MoolenbroekCOMPILE-TIME ISSUES 12*00b67f09SDavid van Moolenbroek------------------- 13*00b67f09SDavid van Moolenbroek 14*00b67f09SDavid van MoolenbroekThe socket library requires a certain level of support from the 15*00b67f09SDavid van Moolenbroekoperating system. In particular, it must follow the advanced ipv6 16*00b67f09SDavid van Moolenbroeksocket API to be usable. The systems which do not follow this will 17*00b67f09SDavid van Moolenbroekcurrently not get any warnings or errors, but ipv6 will simply not 18*00b67f09SDavid van Moolenbroekfunction on them. 19*00b67f09SDavid van Moolenbroek 20*00b67f09SDavid van MoolenbroekThese systems currently include, but are not limited to: 21*00b67f09SDavid van Moolenbroek 22*00b67f09SDavid van Moolenbroek AIX 3.4 (with ipv6 patches) 23*00b67f09SDavid van Moolenbroek 24*00b67f09SDavid van Moolenbroek 25*00b67f09SDavid van MoolenbroekRUN-TIME ISSUES 26*00b67f09SDavid van Moolenbroek--------------- 27*00b67f09SDavid van Moolenbroek 28*00b67f09SDavid van MoolenbroekIn the original drafts of the ipv6 RFC documents, binding an ipv6 29*00b67f09SDavid van Moolenbroeksocket to the ipv6 wildcard address would also cause the socket to 30*00b67f09SDavid van Moolenbroekaccept ipv4 connections and datagrams. When an ipv4 packet is 31*00b67f09SDavid van Moolenbroekreceived on these systems, it is mapped into an ipv6 address. For 32*00b67f09SDavid van Moolenbroekexample, 1.2.3.4 would be mapped into ::ffff:1.2.3.4. The intent of 33*00b67f09SDavid van Moolenbroekthis mapping was to make transition from an ipv4-only application into 34*00b67f09SDavid van Moolenbroekipv6 easier, by only requiring one socket to be open on a given port. 35*00b67f09SDavid van Moolenbroek 36*00b67f09SDavid van MoolenbroekLater, it was discovered that this was generally a bad idea. For one, 37*00b67f09SDavid van Moolenbroekmany firewalls will block connection to 1.2.3.4, but will let through 38*00b67f09SDavid van Moolenbroek::ffff:1.2.3.4. This, of course, is bad. Also, access control lists 39*00b67f09SDavid van Moolenbroekwritten to accept only ipv4 addresses were suddenly ignored unless 40*00b67f09SDavid van Moolenbroekthey were rewritten to handle the ipv6 mapped addresses as well. 41*00b67f09SDavid van Moolenbroek 42*00b67f09SDavid van MoolenbroekPartly because of these problems, the latest IPv6 API introduces an 43*00b67f09SDavid van Moolenbroekexplicit knob (the "IPV6_V6ONLY" socket option ) to turn off the ipv6 44*00b67f09SDavid van Moolenbroekmapped address usage. 45*00b67f09SDavid van Moolenbroek 46*00b67f09SDavid van MoolenbroekIn bind9, we first check if both the advanced API and the IPV6_V6ONLY 47*00b67f09SDavid van Moolenbroeksocket option are available. If both of them are available, bind9 48*00b67f09SDavid van Moolenbroeknamed will bind to the ipv6 wildcard port for both TCP and UDP. 49*00b67f09SDavid van MoolenbroekOtherwise named will make a warning and try to bind to all available 50*00b67f09SDavid van Moolenbroekipv6 addresses separately. 51*00b67f09SDavid van Moolenbroek 52*00b67f09SDavid van MoolenbroekIn any case, bind9 named binds to specific addresses for ipv4 sockets. 53*00b67f09SDavid van Moolenbroek 54*00b67f09SDavid van MoolenbroekThe followings are historical notes when we always bound to the ipv6 55*00b67f09SDavid van Moolenbroekwildcard port regardless of the availability of the API support. 56*00b67f09SDavid van MoolenbroekThese problems should not happen with the closer checks above. 57*00b67f09SDavid van Moolenbroek 58*00b67f09SDavid van Moolenbroek 59*00b67f09SDavid van MoolenbroekIPV6 Sockets Accept IPV4, Specific IPV4 Addresses Bindings Fail 60*00b67f09SDavid van Moolenbroek--------------------------------------------------------------- 61*00b67f09SDavid van Moolenbroek 62*00b67f09SDavid van MoolenbroekThe only OS which seems to do this is (some kernel versions of) linux. 63*00b67f09SDavid van MoolenbroekIf an ipv6 socket is bound to the ipv6 wildcard socket, and a specific 64*00b67f09SDavid van Moolenbroekipv4 socket is later bound (say, to 1.2.3.4 port 53) the ipv4 binding 65*00b67f09SDavid van Moolenbroekwill fail. 66*00b67f09SDavid van Moolenbroek 67*00b67f09SDavid van MoolenbroekWhat this means to bind9 is that the application will log warnings 68*00b67f09SDavid van Moolenbroekabout being unable to bind to a socket because the address is already 69*00b67f09SDavid van Moolenbroekin use. Since the ipv6 socket will accept ipv4 packets and map them, 70*00b67f09SDavid van Moolenbroekhowever, the ipv4 addresses continue to function. 71*00b67f09SDavid van Moolenbroek 72*00b67f09SDavid van MoolenbroekThe effect is that the config file listen-on directive will not be 73*00b67f09SDavid van Moolenbroekrespected on these systems. 74*00b67f09SDavid van Moolenbroek 75*00b67f09SDavid van Moolenbroek 76*00b67f09SDavid van MoolenbroekIPV6 Sockets Accept IPV4, Specific IPV4 Address Bindings Succeed 77*00b67f09SDavid van Moolenbroek---------------------------------------------------------------- 78*00b67f09SDavid van Moolenbroek 79*00b67f09SDavid van MoolenbroekIn this case, the system allows opening an ipv6 wildcard address 80*00b67f09SDavid van Moolenbroeksocket and then binding to a more specific ipv4 address later. An 81*00b67f09SDavid van Moolenbroekexample of this type of system is Digital Unix with ipv6 patches 82*00b67f09SDavid van Moolenbroekapplied. 83*00b67f09SDavid van Moolenbroek 84*00b67f09SDavid van MoolenbroekWhat this means to bind9 is that the application will respect 85*00b67f09SDavid van Moolenbroeklisten-on in regards to ipv4 sockets, but it will use mapped ipv6 86*00b67f09SDavid van Moolenbroekaddresses for any that do not match the listen-on list. This, in 87*00b67f09SDavid van Moolenbroekeffect, makes listen-on useless for these machines as well. 88*00b67f09SDavid van Moolenbroek 89*00b67f09SDavid van Moolenbroek 90*00b67f09SDavid van MoolenbroekIPV6 Sockets Do Not Accept IPV4 91*00b67f09SDavid van Moolenbroek------------------------------- 92*00b67f09SDavid van Moolenbroek 93*00b67f09SDavid van MoolenbroekOn these systems, opening an IPV6 socket does not implicitly open any 94*00b67f09SDavid van Moolenbroekipv4 sockets. An example of these systems are NetBSD-current with the 95*00b67f09SDavid van Moolenbroeklatest KAME patch, and other systems which use the latest KAME patches 96*00b67f09SDavid van Moolenbroekas their ipv6 implementation. 97*00b67f09SDavid van Moolenbroek 98*00b67f09SDavid van MoolenbroekOn these systems, listen-on is fully functional, as the ipv6 socket 99*00b67f09SDavid van Moolenbroekonly accepts ipv6 packets, and the ipv4 sockets will handle the ipv4 100*00b67f09SDavid van Moolenbroekpackets. 101*00b67f09SDavid van Moolenbroek 102*00b67f09SDavid van Moolenbroek 103*00b67f09SDavid van MoolenbroekRELEVANT RFCs 104*00b67f09SDavid van Moolenbroek------------- 105*00b67f09SDavid van Moolenbroek 106*00b67f09SDavid van Moolenbroek3513: Internet Protocol Version 6 (IPv6) Addressing Architecture 107*00b67f09SDavid van Moolenbroek 108*00b67f09SDavid van Moolenbroek3493: Basic Socket Interface Extensions for IPv6 109*00b67f09SDavid van Moolenbroek 110*00b67f09SDavid van Moolenbroek3542: Advanced Sockets Application Program Interface (API) for IPv6 111*00b67f09SDavid van Moolenbroek 112*00b67f09SDavid van Moolenbroek 113*00b67f09SDavid van MoolenbroekId: ipv6,v 1.9 2004/08/10 04:27:51 jinmei Exp 114