Affan, 
The best answer I have to the portability question is to use ioctl()
with the SIOCGIFINDEX request.
Let's see if we get better answers from others. 

The kernel's panic for scope for Link-Local addresses has to do with
the fact that the prefix(fe80) is applicable on all interfaces, so it
doesn't know where to send, just by seeing the destn. It might work
sometime if the implementation allows the value "0" to be used as the
default interface. Same for ipv6mr_interface.

I didn't quite understand what is the issue with getaddrinfo. But I
think implementations allow passing interfaces along with the scopes.
Eg.  getaddrinfo("fe80::1%eth0"...)

regards,
Sukhdeep

>>> MIP Team <[EMAIL PROTECTED]> 09/28/02 10:54AM >>>
hello,
 My box is a Linux RH 7.2 with the ipv6 module inserted. 
 I have been able tro successfully solve the problem by using
if_nametoindex and setting the id for "eth0" to the sin6_scope_id. But
i have read else where that this is a not a very portable solution.
somehow getaddrinfo can resolve the scope ambiguity that the kernel
faces when sending on link local addreses. Do you have any idea how
this happens?
Also why does the kernel only panic for link local addresses and not
for the global ones. Also the IPv6 multicast program that i had run
with 0 as the ipv6mr_interface. What allows the kernel to decide which
interface to use in some cases and become confused in others?

Again thank you for ur invaluable help.



--- Sukhdeep Johar <[EMAIL PROTECTED]> wrote:
> You need to map  the interfaces (eth0 , sl1 , etc) to an interface
> number. 
> 
> How this is done is interface dependent. 2553 talks of some api's - 
> if_nametoindex , if_indextoname , but how the same is achieved is
not
> defined. 
> I quote from RFC 2553 - 
> 4.4BSD implementations can implement these functions using the
> existing
> sysctl() function with the NET_RT_IFLIST command. Other
> implementations
> may wish to use ioctl() for this
> 
> Please send your system details, and somebody may help. 
> 
> regds,
> Sukhdeep
> 
> >>> MIP Team <[EMAIL PROTECTED]> 09/27/02 10:08AM >>>
> Thank you for your help,
>   
> I have confirmed that my BSD api supports the sin6_scope_id field in
> the sockaddr_in6 struct. However what should be the value that I set
> for the link local addresses. Currently I am probably setting ot to
> zero (memcpy the entire structure zero and donot assign any thing to
> it). are there any #defines that i can look up for different scope.
I
> have Unix Netwrok programming by W.Richards but since its published
> in
> 1998 no such info is provided in it. Please tell me what value i
> should
> assign so that it works on link local or site local addresses!
> 
> Regards
> Affan
> 
>  
> 
> --- Sukhdeep Johar <[EMAIL PROTECTED]> wrote:
> > >> Some IPv6 implementations may not support link-local
> addresses(or
> > scopes)
> > This comment is wrt the BSD api support for scopes only. ( not
IPv6
> > stack)
> > 
> > >>> "Sukhdeep Johar" <[EMAIL PROTECTED]> 09/26/02 03:29PM >>>
> > Did you specify the parameter sin6_scope_id also ? 
> > That will be required along with the Link Local addresses. 
> > 
> > It also depends on what system you are using. Some IPv6
> > implementations
> > may not support link-local addresses(or scopes). You will have to
> > check
> > that.
> > 
> > regards,
> > Sukhdeep
> > 
> > >>> MIP Team <[EMAIL PROTECTED]> 09/26/02 12:20PM >>>
> > Hello,
> >  I have encountered a very strange problem. While trying to
connect
> > (via a SOCK_STREAM socket) to a remote system and supplying its
> link
> > local address (FE80:... ) the connect call failed with perror
> saying
> > that the arguments were invalid. 
> > However when i added a globally unique IP to the same remote
system
> > (3ffe::4f) and supplied this address to the client, the same
> > client-server program worked perfectly fine.
> >  My question is this: are the link local addresses somethings that
> > cannot be used for communicating in the berkley API? or is there
> > something that I am missing over here?
> > 
> > What do you people opine!
> > Regards,
> > Affan Ahmed
> > 
> > 
> > 
> > __________________________________________________
> > Do you Yahoo!?
> > New DSL Internet Access from SBC & Yahoo!
> > http://sbc.yahoo.com 
> >
>
---------------------------------------------------------------------
> > The IPv6 Users Mailing List
> > Unsubscribe by sending "unsubscribe users" to [EMAIL PROTECTED] 
> >
>
---------------------------------------------------------------------
> > The IPv6 Users Mailing List
> > Unsubscribe by sending "unsubscribe users" to [EMAIL PROTECTED] 
> 
> 
> __________________________________________________
> Do you Yahoo!?
> New DSL Internet Access from SBC & Yahoo!
> http://sbc.yahoo.com 


__________________________________________________
Do you Yahoo!?
New DSL Internet Access from SBC & Yahoo!
http://sbc.yahoo.com
---------------------------------------------------------------------
The IPv6 Users Mailing List
Unsubscribe by sending "unsubscribe users" to [EMAIL PROTECTED]

Reply via email to