(usagi-users 03752) Re: want same behavior as ipv4(scope_id)
"Amrit Soni" <[email protected]> 2 Oct 2006 07:39:46 -0000
| Newsgroups | gmane.linux.ipv6.usagi.users |
|---|---|
| Message-ID | <[email protected]> |
It doesn't work for me. I'm using a link local address and my linux kernel version is 2.4.20. Do i need to upgrade my linux kernal or what should i fill in scope_id to make my application work on local m/c as well as on network. Thanks -Amrit On Mon, 02 Oct 2006 Rémi Denis-Courmont wrote : >N.B.: I think it would be more appropriate to discuss this on >usagi-users than an IETF mailing list... > >Le dimanche 1 octobre 2006 21:36, Amrit Soni a écrit : > > I've ported my application to IPv6. I open socket/bind to ethernet > > interface(scope id=2,eth0) but it doesn't work if i run two instances > > of my application on the same machine. I'm using redhat9 linux. > >Why the heck do you bind to a specific interface at all? That should not >be necessary for usual socket/bind/listen/accept and >socket/bind/recvmsg/sendmsg code paths. > > > If i assign scope_id to 0(loopback i/f) > >0 is certainly not the lo(opback) scope ID. That would be in direct >violation of the relevant POSIX and IETF standards, as 0 is the error >return value of the if_nametoindex() API. > >If you put 0 in a sockaddr_in6, you don't bind to any specific >interface. This indeed leaves the scope ID undefined, and that's what >pretty much every IPv6-aware applications do. > > > then it works only on my machine. But in IPv4 there is no field as > > scope id, it works on local host as well as on network. I want the > > same behaviour as IPv4. > >That's precisely what sin6_scope_id=0 does. > > > Pls let me know what should i do to make my > > application scope independent. Is it a bug in linux kernal? > >I don't think so. > >-- >Rémi Denis-Courmont >http://www.remlab.net/