Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 04 Sep 2014 10:42:59 -0400
From:      John Baldwin <jhb@freebsd.org>
To:        freebsd-net@freebsd.org
Cc:        Craig Rodrigues <rodrigc@freebsd.org>, "Andrey V. Elsukov" <ae@freebsd.org>, bugzilla-noreply@freebsd.org
Subject:   Re: [Bug 193246] Bug in IPv6 multicast join(), uncovered by Jenkins
Message-ID:  <3393302.jtrfEtP2nm@ralph.baldwin.cx>
In-Reply-To: <CAG=rPVe05jnxrD8QDkvwThBhKz7GCECRKTjK=XenAhbKwUB%2BPw@mail.gmail.com>
References:  <bug-193246-2472@https.bugs.freebsd.org/bugzilla/> <54070758.2050405@FreeBSD.org> <CAG=rPVe05jnxrD8QDkvwThBhKz7GCECRKTjK=XenAhbKwUB%2BPw@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Wednesday, September 03, 2014 06:39:53 AM Craig Rodrigues wrote:
> On Wed, Sep 3, 2014 at 5:19 AM, Andrey V. Elsukov <ae@freebsd.org> wrote:
> > On 03.09.2014 14:05, bugzilla-noreply@freebsd.org wrote:
> > 
> > Hi,
> > 
> > you said that this code works in linux. I looked in the linux kernel
> > source, and I think it should return EINVAL too.
> > 
> > net/ipv6/mcast.c:ipv6_sock_mc_join:
> >  154         if (!ipv6_addr_is_multicast(addr))
> >  155                 return -EINVAL;
> 
> The code does work in Linux.  However, you need to look at the
> JDK source, not the Linux kernel source.
> 
> In this file:
> http://hg.openjdk.java.net/jdk7/jdk7/jdk/file/9b8c96f96a0f/src/solaris/nativ
> e/java/net/PlainDatagramSocketImpl.c
> 
> in the mcast_join_leave() function, there are two code paths: (1)
> Linux, (2) Solaris.
> 
> It looks like on Solaris, they support IPv4-mapped multicast addresses for
> IPV6, and things work when they create an IPv6 socket, and then put an
> IPv4-mapped multicast address in it.  For Linux, they have specific
> code paths in that function which seem to force creating an IPv4
> socket.

>From looking at the source, it doesn't look like the Linux workaround (using 
IP_ADD_MEMBERSHIP on an AF_INET6 socket) will work on FreeBSD.  I'm not sure 
how hard it would be to fix in6_mcast.c to support IPv4 groups.  bms@ might 
know.

-- 
John Baldwin



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3393302.jtrfEtP2nm>