[
https://jira.jboss.org/jira/browse/JGRP-956?page=com.atlassian.jira.plugi...
]
Richard Achmatowicz commented on JGRP-956:
------------------------------------------
The confusing error message which is generated when we try to bind to IPv6 multicast
address is:
16:35:19,970 INFO [DefaultPartition] Initializing partition DefaultPartition
16:35:20,231 WARN [UDP] could not bind to /ff02:0:0:0:0:1:2:3 (IPv6 address); make sure
your mcast_addr is of the same type as the IP stack (IPv4 or IPv6).
Will ignore mcast_addr, but this may lead to cross talking (see
http://www.jboss.com/wiki/Edit.jsp?page=CrossTalking for details).
Exception was: java.net.SocketException: Invalid argument
16:35:20,289 INFO [STDOUT]
---------------------------------------------------------
GMS: address is fe80:0:0:0:215:17ff:fe2d:6821:44270 (cluster=DefaultPartition)
---------------------------------------------------------
It turns out that this message is confusing, but entirely accurate. This exception occurs
when three conditions are present:
(i) we pass an IPv6 multicast address
(ii) we try to bind to the multicast socket formed from multicast address and multicast
port
(iii) we prefer the IPv4 stack using java.net.preferIPv4Stack=true
After the exception
java.net.SocketException: Invalid argument (i.e. you're trying to bind
an IPv6 mcast address to an IPv4 stack)
the code will then try to bind only to the multicast port and it is indeed the case that
when we bind to the multicast port only in IPv6, we do get crosstalk.
Binding to mcast address in UDP.java is not working on Linux with
IPv6
----------------------------------------------------------------------
Key: JGRP-956
URL:
https://jira.jboss.org/jira/browse/JGRP-956
Project: JGroups
Issue Type: Bug
Reporter: Richard Achmatowicz
Assignee: Bela Ban
Priority: Minor
Fix For: 2.8
On Linux and Solaris platforms, when setting up the main multicast receiver socket, Bela
allows binding the socket to its multicast address, like this:
InetAddress group_addr = ...
InetAddress bind_addr = ...
SocketAddress group_sock_addr = new InetSocketAddress(group_addr, port) ;
MulticastSocket s = new MulticastSocket(group_sock_addr) ; // funny
s.joinGroup(group_addr) ;
Binding to the multicast address on Linux and Solaris was done in order to avoid the
promiscuous traffic problem. A detailed discussion on the matter can be found in the
bugzilla
report:https://bugzilla.redhat.com/show_bug.cgi?id=231899.
This works on Linux with IPv4 but is not working on Linux with IPv6 for the
multicast-address ff02::1 - an error message is being generated (SocketException, invalid
argument) and the code then tries to create the same multicast address in the usual way:
InetAddress group_addr = ...
InetAddress bind_addr = ...
MulticastSocket s = new MulticastSocket(port) ;
s.setInterface(bind_addr) ;
s.joinGroup(group_addr) ;
This is only a problem in that it generates a confusing error message about using mixed
IPv4 / IPv6 stacks, but the socket continues to work correctly as far as I can tell.
Haven't confirmed this, but I believe the promiscuous traffic issue does not arise
with IPv6 multicast sockets.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira