Click here to get back home

IPV6 socket connection, with a link-local address

 HomeNewsGroups | Search | About
 comp.lang.perl.modules    Post an article   get this group's latest topics as an RSS feed add this group's latest topics to your My MSN content add this group's latest topics to your My Yahoo content
Subject Author Date
IPV6 socket connection, with a link-local address papag 01-11-2008
Posted by papag on January 11, 2008, 1:12 pm
Please log in for more thread options
Here is my scenario:
If I use a global unicast IPV6 address, everything works as it should.
If I use a link local address, i.e. FE80::, I am not able to bind my
socket properly. I get an "unknown error" response. I have tried with
the scope (i.e. %6) and without.

Here are the issues I see:
1) If giving a peerAddr in the format [fe80::211:43ff:fe1e:ffed]:1300,
the _sock_info call works as it should, it strips off the port and
braces, and puts only fe80::211:43ff:fe1e:ffed in the $laddr. If
instead the peerAddr is in this format [fe80::211:43ff:fe1e:ffed%6]:
1300 (note the %6 scope id), _sock_info does not work as it should, it
does not strip off the braces I get [fe80::211:43ff:fe1e:ffed%6].

2) If I manually set $laddr to fe80::211:43ff:fe1e:ffed%6 (note I
removed the braces), the code continues successfully. I eventually get
to the inet_pton call, here is what I see:

DB<4> x 2 inet_pton(AF_INET6, 'fe80::211:43ff:fe1e:ffed%6')
undef

DB<5> x 2 inet_pton(AF_INET6, 'fe80::211:43ff:fe1e:ffed')
"=E2=96=A0=C3=87\c@\c@\c@\c@\c@\c@\cB\cQC =E2=96=A0\c^ =CF=86"

So as you can see having the %6 in as part of the ip, causes the call
to return undef, not having it gives a somewhat valid return, but this
return does not allow for a bind to take place.

If I use a global unicast address, as I said everything works, I get
this:

DB<8> x 2 inet_pton(AF_INET6, '2002:80dd:254f::80dd:254f')
" \cB=C3=87=E2=96=8C%O\c@\c@\c@\c@\c@\c@=C3=87=E2=96=8C%O"

This return works and allows a successful bind.

I think the whole issue stems from the fact that the scope identifier
is not being treated correctly in inet_pton.
Any Ideas?

Similar ThreadsPosted
HTTP::Daemon IPv6 support? March 16, 2006, 5:18 pm
Ip address Data Type DBI May 10, 2006, 4:38 pm
Can't find Module IP::Address February 27, 2008, 3:42 pm
Email address syntax check? December 2, 2006, 2:58 pm
IO::Socket::SSL March 24, 2005, 10:10 pm
LWP and socket May 1, 2007, 6:06 pm
Looking for module that will expands domain/username to email address October 23, 2004, 12:56 am
IO::Socket sometimes hang, why? Please help November 7, 2004, 7:54 pm
IO::Socket->socketpair() May 21, 2007, 3:25 pm
No connection using LWP October 27, 2006, 5:30 pm

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap