Thanks for the prompt reply.
sorry it was 1 for loopback interface.
But when i keep scope_id as 0, it returns error while binding.
What should i assign to scope id so that it can work for both loopback as well as for ethernet interface. I'm not using getaddrinfo() api.
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/
-------------------------------------------------------------------- IETF IPv6 working group mailing list [email protected] Administrative Requests: https://www1.ietf.org/mailman/listinfo/ipv6 --------------------------------------------------------------------
