On May 20, 2007, at 7:46 AM, Peter Marschall wrote:
On Tuesday, 15. May 2007 02:20, Graham Barr wrote:
My understanding is that IPv6 support is added to IO::Socket by a
separate module, IO::Socket::INET6, which in turn uses Socket6
which is
an add-on module to the standard Socket module.
Yes, that is correct.
So where LDAP.pm now calls IO::Socket::INET, it would need to call
IO::Socket::INET6. The new INET6 Domain argument already defaults to
AF_UNSPEC, so I don't believe that needs to be specified; though,
for
testing purposes, it might be nice if Net::LDAP externalised it.
Any, or all, of the above might be total rubbish... :)
I have not looked at INET6 and I do not have easy access to test
INET6, but if someone wants to send a patch then I would gladly
incorporate it.
I have tried to write a little patch to Net::LDAP that should
implement support for IPv6.
It tries to stay compatible as much as possible.
Only if the
inet6 => 1
option is passed to Net::LDAP->new() it takes the IPv6 variants
of the modules into account.
That is fine for now. IO::Socket::INET6 is suppose to fallback to IPv4
if it cannot find a v6 address. So in the long term I think we should
default to using INET6 if the module is available and fallback to ::INET
But that is only after we are satisfied it works as we expect.
It works well with IPv4 (even when inet6 is set), but fails
with IPv6 in my ienvironment: the connection gets immediately
closed by the server.
This might be a problem of my environment or of the patch.
Currently I cannot tell, since this was my first tyoing with IPv6.
That is encouraging. However, I am not sure I like how IO::Socket::SSL
switches between v4 and v6. It uses arguments passed to import to change
@ISA. Which means @ISA can change from INET to INET6 or back at runtime.
Graham.