netdev
[Top] [All Lists]

Re: IPv6 has trouble assigning an interface

To: Felix von Leitner <felix-linuxkernel@xxxxxxx>
Subject: Re: IPv6 has trouble assigning an interface
From: David Stevens <dlstevens@xxxxxxxxxx>
Date: Mon, 25 Apr 2005 15:38:15 -0700
Cc: linux-kernel@xxxxxxxxxxxxxxx, netdev@xxxxxxxxxxx, netdev-bounce@xxxxxxxxxxx, "YOSHIFUJI Hideaki / ?$B5HF#1QL@" <yoshfuji@xxxxxxxxxxxxxx>
In-reply-to: <20050425195736.GB3123@codeblau.de>
Sender: netdev-bounce@xxxxxxxxxxx
It's failing because it doesn't know what interface you want to send on, 
and link-local
addresses don't narrow that down any. If you bind to a specific IPv6 
address, it'll use
that interface (as a work-around). Adding a route for the multicast 
address may also
work (haven't tried). I'd expect using IPV6_MULTICAST_IF would work, but a 
quick
test appears that it doesn't. Specifying a sin6_scope_id as the interface 
index on the
sendto() is another way of specifying the device that doesn't appear to 
work.

So, there may be a bug. Note that if you bind to "::" without doing 
anything else and
send to a link-local address, it can't know what interface you want to 
send on by
the destination, so your program won't control which interface it'll send 
on. Doing
that by binding to a specific interface's IPv6 address works for me (the 
failure is
in assigning the source address when it isn't known). Specifying the 
device in
other ways ought to work, too, so I'll look into this a bit more (as will 
others, no doubt).

                                                        +-DLS

> ff02 is a link-local multicast address.  I've bound to ::.  How can this
> fail?  link-local should always work, even if no routes are set and no
> router has been found.

> Felix


<Prev in Thread] Current Thread [Next in Thread>