+ if ((GNUNET_YES == plugin->enable_ipv6) &&
+ (NULL != plugin->sockv6) &&
+ (addrlen == sizeof (struct sockaddr_in6)))
+ {
+ /* Create IPv6 multicast request */
+ struct ipv6_mreq multicastRequest;
+ const struct sockaddr_in6 *s6 = (const struct sockaddr_in6 *) broadcast_addr;
+
+ multicastRequest.ipv6mr_multiaddr =
+ plugin->ipv6_multicast_address.sin6_addr;
+ /* http://tools.ietf.org/html/rfc2553#section-5.2:
+ *
+ * IPV6_JOIN_GROUP
+ *
+ * Join a multicast group on a specified local interface. If the
+ * interface index is specified as 0, the kernel chooses the local
+ * interface. For example, some kernels look up the multicast
+ * group in the normal IPv6 routing table and using the resulting
+ * interface; we do this for each interface, so no need to use
+ * zero (anymore...).
+ */
+ multicastRequest.ipv6mr_interface = s6->sin6_scope_id;
+
+ /* Join the multicast group */
+ if (GNUNET_OK !=
+ GNUNET_NETWORK_socket_setsockopt
+ (plugin->sockv6, IPPROTO_IPV6, IPV6_JOIN_GROUP,
+ &multicastRequest, sizeof (multicastRequest)))
+ {
+ LOG (GNUNET_ERROR_TYPE_WARNING,
+ "Failed to join IPv6 multicast group: IPv6 broadcasting not running\n");
+ }
+ else
+ {
+#if LINUX
+ /*
+ * setup Cryogenic FD for ipv6 broadcasting
+ */
+ char *filename;
+
+ GNUNET_asprintf (&filename,
+ "/dev/cryogenic/%s",
+ name);
+ if (0 == ACCESS (name, R_OK))
+ {
+ ba->cryogenic_fd =
+ GNUNET_DISK_file_open (filename,
+ GNUNET_DISK_OPEN_WRITE,
+ GNUNET_DISK_PERM_NONE);
+ }
+ GNUNET_free (filename);
+#endif
+ ba->broadcast_task =
+ GNUNET_SCHEDULER_add_now (&udp_ipv6_broadcast_send, ba);
+ }
+ }
+ GNUNET_CONTAINER_DLL_insert (plugin->broadcast_head,
+ plugin->broadcast_tail, ba);