[jboss-jira] [JBoss JIRA] Commented: (JGRP-956) Binding to mcast address in UDP.java is not working on Linux with IPv6
Bela Ban (JIRA)
jira-events at lists.jboss.org
Tue May 12 09:57:46 EDT 2009
[ https://jira.jboss.org/jira/browse/JGRP-956?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12466985#action_12466985 ]
Bela Ban commented on JGRP-956:
-------------------------------
Apparently, we need to use global IPv6 addresses, or -if not - we need to provide a scope-id. The algorithm for generating the scope-id is (onlt for *non global* addrs):
* If there is an attached scope-id: no-op
* Else
o Find all interfaces which have the address configured
o If the resulting set has 1 interface: add the interface name
to the address, ie. ADDR%IFNAME
o Else if the result set has more than 1 address: throw an
exception saying that the user has to provide the non-global
IPv6 address with a scope-id
This should be relatively simple to implement, and JGroups finding out the correct scope-id should also be simple, except for the case where identical link-local addresses are defined on multiple interfaces.
This needs to be in the 2.4 and 2.6 branches and on head
> 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
More information about the jboss-jira
mailing list