📄 ipv6
字号:
Copyright (C) 2004 Internet Systems Consortium, Inc. ("ISC")Copyright (C) 2000, 2001 Internet Software Consortium.See COPYRIGHT in the source root or http://isc.org/copyright.html for terms.Currently, there are multiple interesting problems with ipv6implementations on various platforms. These problems range from notbeing able to use ipv6 with bind9 (or in particular the ISC socketlibrary, contained in libisc) to listen-on lists not being respected,to strange warnings but seemingly correct behavior of named.COMPILE-TIME ISSUES-------------------The socket library requires a certain level of support from theoperating system. In particular, it must follow the advanced ipv6socket API to be usable. The systems which do not follow this willcurrently not get any warnings or errors, but ipv6 will simply notfunction on them.These systems currently include, but are not limited to: AIX 3.4 (with ipv6 patches)RUN-TIME ISSUES---------------In the original drafts of the ipv6 RFC documents, binding an ipv6socket to the ipv6 wildcard address would also cause the socket toaccept ipv4 connections and datagrams. When an ipv4 packet isreceived on these systems, it is mapped into an ipv6 address. Forexample, 1.2.3.4 would be mapped into ::ffff:1.2.3.4. The intent ofthis mapping was to make transition from an ipv4-only application intoipv6 easier, by only requiring one socket to be open on a given port.Later, it was discovered that this was generally a bad idea. For one,many firewalls will block connection to 1.2.3.4, but will let through::ffff:1.2.3.4. This, of course, is bad. Also, access control listswritten to accept only ipv4 addresses were suddenly ignored unlessthey were rewritten to handle the ipv6 mapped addresses as well.Partly because of these problems, the latest IPv6 API introduces anexplicit knob (the "IPV6_V6ONLY" socket option ) to turn off the ipv6mapped address usage.In bind9, we first check if both the advanced API and the IPV6_V6ONLYsocket option are available. If both of them are available, bind9named will bind to the ipv6 wildcard port for both TCP and UDP.Otherwise named will make a warning and try to bind to all availableipv6 addresses separately.In any case, bind9 named binds to specific addresses for ipv4 sockets.The followings are historical notes when we always bound to the ipv6wildcard port regardless of the availability of the API support.These problems should not happen with the closer checks above.IPV6 Sockets Accept IPV4, Specific IPV4 Addresses Bindings Fail---------------------------------------------------------------The only OS which seems to do this is (some kernel versions of) linux.If an ipv6 socket is bound to the ipv6 wildcard socket, and a specificipv4 socket is later bound (say, to 1.2.3.4 port 53) the ipv4 bindingwill fail.What this means to bind9 is that the application will log warningsabout being unable to bind to a socket because the address is alreadyin use. Since the ipv6 socket will accept ipv4 packets and map them,however, the ipv4 addresses continue to function.The effect is that the config file listen-on directive will not berespected on these systems.IPV6 Sockets Accept IPV4, Specific IPV4 Address Bindings Succeed----------------------------------------------------------------In this case, the system allows opening an ipv6 wildcard addresssocket and then binding to a more specific ipv4 address later. Anexample of this type of system is Digital Unix with ipv6 patchesapplied.What this means to bind9 is that the application will respectlisten-on in regards to ipv4 sockets, but it will use mapped ipv6addresses for any that do not match the listen-on list. This, ineffect, makes listen-on useless for these machines as well.IPV6 Sockets Do Not Accept IPV4-------------------------------On these systems, opening an IPV6 socket does not implicitly open anyipv4 sockets. An example of these systems are NetBSD-current with thelatest KAME patch, and other systems which use the latest KAME patchesas their ipv6 implementation.On these systems, listen-on is fully functional, as the ipv6 socketonly accepts ipv6 packets, and the ipv4 sockets will handle the ipv4packets.RELEVANT RFCs-------------3513: Internet Protocol Version 6 (IPv6) Addressing Architecture3493: Basic Socket Interface Extensions for IPv63542: Advanced Sockets Application Program Interface (API) for IPv6$Id: ipv6,v 1.5.206.4 2004/08/10 04:28:15 jinmei Exp $
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -