[ds6-devel] problem connecting to ipv6 sockets
Lionel Elie Mamane
lionel at mamane.lu
Tue Jan 6 08:14:23 CET 2004
On Tue, Jan 06, 2004 at 02:33:00PM +0800, Parijat wrote:
> On Mon, Jan 05, 2004 at 03:04:12PM +0100, Andreas Hofmann wrote:
>> ip6client local6 ---> does not work
>> ip6client fe80::20b:cdff:fef8:1c32 ---> does not work
> The problem with the above two is that the clien is trying to make a
> connection to a "link-local" address. One requirement of sockets
> using or connecting to link-local addresses is that the interface on
> which the connection should be made must also be specified.
Indeed. Try this:
ip6client fe80::20b:cdff:fef8:1c32%eth0
>> the sources of these two small apps are below. where is the mistake i made?
>> any ideas?
>> if(connect(sockfd, res->ai_addr, res->ai_addrlen)==0){
> Here, connect expects that res->ai_addr.sin6_scopeif would contain a
> valid interface id, and IMO getaddrinfo() does not set this.
It does, if the address contains the %eth0 part.
--
Lionel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://lists.deepspace6.net/archive/ds6-devel/attachments/20040106/84ba1f3f/attachment.bin
More information about the ds6-devel
mailing list