[Olsr-users] IPv6: Using link-local all-hosts multicast address ff02::1 instead of ff0e::1 with Linux?
Roar Bjørgum Rotvik
(spam-protected)
Wed Aug 20 14:01:24 CEST 2008
Joerg Pommnitz wrote:
> Hello all,
> I'm trying to use ff02::1 instead of the default ff0e::1 as multicast
> address for OLSR in IPv6. Unfortunately I always get "Network is
> unreachable".
> Besides the code in olsrd-0.5.3 I tried the following modifications:
> 1) use sendmsg instead of sendto. With sendmsg one can add a control
> message to the data and specify the interface to use for the outbound
> data. This is what ping6 uses ("ping6 ff02::1" fails while "ping6 -I
> interface ff02::1" works as expected). Unfortunately that did not work.
Why not bind mcast socket to correct interface before sendto()? Would not need sendmsg()
with control messages then.
I don't know if the error message should be gone then, but it is a small change if you
would like to test it..
What are the control message option you use with sendmsg()?
Example to bind a socket to a physical interface:
char device[] = "eth0";
if (setsockopt (socket, SOL_SOCKET, SO_BINDTODEVICE, device,
strlen (device) + 1) == -1)
{
fprintf (stderr,
"Failed to bind socket to interface %s: %d - %s\n",
device, errno, strerror (errno));
}
--
Roar Bjørgum Rotvik
More information about the Olsr-users
mailing list