[Olsr-users] Solved: IPv6: Using link-local all-hosts multicast address ff02::1 instead of ff0e::1 with Linux?
Joerg Pommnitz
(spam-protected)
Wed Aug 20 15:08:29 CEST 2008
Found it!
Using link-local addresses the Linux kernel looks at the sin6_scope_id
member of a struct sockaddr_in6. This one was randomly initialized.
Patch (against 0.5.3):
--- src/unix/ifnet.c (revision 1975)
+++ src/unix/ifnet.c (working copy)
@@ -776,13 +776,14 @@
OLSR_PRINTF(debuglvl, "\tAddress: %s\n", ip6_to_string(&ifs.int6_addr.sin6_addr));
/* Multicast */
+ memset (&ifs.int6_multaddr, 0, sizeof (ifs.int6_multaddr));
+ ifs.int6_multaddr.sin6_family = AF_INET6;
+ ifs.int6_multaddr.sin6_flowinfo = htonl(0);
+ ifs.int6_multaddr.sin6_scope_id = if_nametoindex(ifr.ifr_name);
+ ifs.int6_multaddr.sin6_port = htons(OLSRPORT);
ifs.int6_multaddr.sin6_addr = (iface->cnf->ipv6_addrtype == IPV6_ADDR_SITELOCAL) ?
iface->cnf->ipv6_multi_site.v6 :
iface->cnf->ipv6_multi_glbl.v6;
- /* Set address family */
- ifs.int6_multaddr.sin6_family = AF_INET6;
- /* Set port */
- ifs.int6_multaddr.sin6_port = htons(OLSRPORT);
#ifdef __MacOSX__
ifs.int6_multaddr.sin6_scope_id = 0;
--
Regards
Joerg
__________________________________________________
Do You Yahoo!?
Sie sind Spam leid? Yahoo! Mail verfügt über einen herausragenden Schutz gegen Massenmails.
http://mail.yahoo.com
More information about the Olsr-users
mailing list