From owner-freebsd-net@FreeBSD.ORG Wed Sep 3 13:39:56 2014 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 21B98D69; Wed, 3 Sep 2014 13:39:56 +0000 (UTC) Received: from mail-la0-x22a.google.com (mail-la0-x22a.google.com [IPv6:2a00:1450:4010:c03::22a]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 486CF1972; Wed, 3 Sep 2014 13:39:55 +0000 (UTC) Received: by mail-la0-f42.google.com with SMTP id mc6so9853569lab.1 for ; Wed, 03 Sep 2014 06:39:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=TT0hyf4BjM1IZhBGMMPGnxGTUIGzLVkIiif8Ms96+00=; b=d26ORNwntcfouTXQRRhu7Z/DTlnWbYoq2B7HjKP72KFDA8Ah9ChxbdATbJDXohEN4Y GZpNJ3xGxxzEORJKZmJ6byy1XlxpDpZPCGAfsP6njpuNl9R1KG7cH8D7b8Z//VNR7Wxd v8DMIvdXqjp2VfyNiUV7fPU9XiuY04TGdxl8BWOyCMKBEBq6U1rJdxxqGP0R7s5lnr4x 7BQSn5/4opM0uTamB7lUTrXgrlM8m0glLk3C7PwjciOEJuLy0Hy8ilA6g0B8cEuFLLr1 sR0T+XGsDOchrkiPdXrQ3FqeE/kgTUuogircyIxtvcI338q7IoEvMtGJDZhSAOgjO3P7 CCcQ== MIME-Version: 1.0 X-Received: by 10.152.20.41 with SMTP id k9mr41119994lae.57.1409751593235; Wed, 03 Sep 2014 06:39:53 -0700 (PDT) Sender: crodr001@gmail.com Received: by 10.112.197.107 with HTTP; Wed, 3 Sep 2014 06:39:53 -0700 (PDT) In-Reply-To: <54070758.2050405@FreeBSD.org> References: <54070758.2050405@FreeBSD.org> Date: Wed, 3 Sep 2014 06:39:53 -0700 X-Google-Sender-Auth: bpDodc5saVkclzXN8PULa_wobQg Message-ID: Subject: Re: [Bug 193246] Bug in IPv6 multicast join(), uncovered by Jenkins From: Craig Rodrigues To: "Andrey V. Elsukov" Content-Type: text/plain; charset=ISO-8859-1 Cc: freebsd-net@freebsd.org, bugzilla-noreply@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:39:56 -0000 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. -- Craig