From owner-freebsd-net@FreeBSD.ORG Wed Sep 3 13:45:57 2014 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx2.freebsd.org (mx2.freebsd.org [IPv6:2001:1900:2254:206a::19:2]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 082CE317; Wed, 3 Sep 2014 13:45:57 +0000 (UTC) Received: from butcher-nb.yandex.net (hub.freebsd.org [IPv6:2001:1900:2254:206c::16:88]) by mx2.freebsd.org (Postfix) with ESMTP id 07F782898; Wed, 3 Sep 2014 13:45:54 +0000 (UTC) Message-ID: <54071B5A.6040303@FreeBSD.org> Date: Wed, 03 Sep 2014 17:44:58 +0400 From: "Andrey V. Elsukov" User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:24.0) Gecko/20100101 Thunderbird/24.5.0 MIME-Version: 1.0 To: Craig Rodrigues Subject: Re: [Bug 193246] Bug in IPv6 multicast join(), uncovered by Jenkins References: <54070758.2050405@FreeBSD.org> In-Reply-To: X-Enigmail-Version: 1.6 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: freebsd-net@freebsd.org X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Sep 2014 13:45:57 -0000 On 03.09.2014 17:39, Craig Rodrigues wrote: > On Wed, Sep 3, 2014 at 5:19 AM, Andrey V. Elsukov 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/native/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. Yes, I have illumos-gate's code and I can confirm, that IPv4-mapped IPv6 addresses have special handling in multicast code. -- WBR, Andrey V. Elsukov