From peter@rulingia.com  Wed Jan  1 19:33:22 2014
Return-Path: <peter@rulingia.com>
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
	(using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
	(No client certificate requested)
	by hub.freebsd.org (Postfix) with ESMTPS id AE8E280B
	for <FreeBSD-gnats-submit@freebsd.org>; Wed,  1 Jan 2014 19:33:22 +0000 (UTC)
Received: from vps.rulingia.com (vps.rulingia.com [103.243.244.15])
	(using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
	(No client certificate requested)
	by mx1.freebsd.org (Postfix) with ESMTPS id 499191EAC
	for <FreeBSD-gnats-submit@freebsd.org>; Wed,  1 Jan 2014 19:33:21 +0000 (UTC)
Received: from server.rulingia.com (c220-239-250-249.belrs5.nsw.optusnet.com.au [220.239.250.249])
	by vps.rulingia.com (8.14.7/8.14.7) with ESMTP id s01JXDHx025651
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK)
	for <FreeBSD-gnats-submit@freebsd.org>; Thu, 2 Jan 2014 06:33:13 +1100 (EST)
	(envelope-from peter@rulingia.com)
Received: from server.rulingia.com (localhost.rulingia.com [127.0.0.1])
	by server.rulingia.com (8.14.7/8.14.7) with ESMTP id s01JX7j8065524
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO);
	Thu, 2 Jan 2014 06:33:07 +1100 (EST)
	(envelope-from peter@server.rulingia.com)
Received: (from peter@localhost)
	by server.rulingia.com (8.14.7/8.14.7/Submit) id s01JX76B065523;
	Thu, 2 Jan 2014 06:33:07 +1100 (EST)
	(envelope-from peter)
Message-Id: <201401011933.s01JX76B065523@server.rulingia.com>
Date: Thu, 2 Jan 2014 06:33:07 +1100 (EST)
From: Peter Jeremy <peter@rulingia.com>
Reply-To: Peter Jeremy <peter@rulingia.com>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: IPv4 Multicast broken in 10.x
X-Send-Pr-Version: 3.114
X-GNATS-Notify:

>Number:         185395
>Category:       kern
>Synopsis:       IPv4 Multicast broken in 10.x
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    glebius
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Wed Jan 01 19:40:00 UTC 2014
>Closed-Date:    Wed Jan 22 10:15:00 UTC 2014
>Last-Modified:  Wed Jan 22 10:15:00 UTC 2014
>Originator:     Peter Jeremy
>Release:        FreeBSD 10.0-PRERELEASE amd64
>Organization:
n/a
>Environment:
System: FreeBSD server.rulingia.com 10.0-PRERELEASE FreeBSD 10.0-PRERELEASE #22 r259613M: Sat Dec 21 09:49:27 EST 2013 root@server.rulingia.com:/var/obj/usr/src/sys/server amd64

Also verified on 10.0-ALPHA1 r255569 arm and r259613M i386.

>Description:
	IPv4 multicast ethernet frames use the IP address of the default
	route in the destination MAC address, instead of the IP address of
	the multicast destination.  This breaks multicast filtering at the
	receiver.

	This is a regression from FreeBSD 9.2.

>How-To-Repeat:

	Run (eg) 'tcpdump -e icmp' on one terminal and 'ping 224.18.52.86'
	in another window.  The tcpdump should show ICMP packets with a
	destination MAC address of 01:00:5E:12:34:56 but, in my case, they
	have a destination MAC address of 01:00:5E:28:7B:7B - which matches
	the IP address of my router.

>Fix:
	Unknown.  The cause isn't obvious from a cursory look at the 9.x
	and 10.x code.
>Release-Note:
>Audit-Trail:

From: =?ISO-8859-1?Q?Olivier_Cochard=2DLabb=E9?= <olivier@cochard.me>
To: Peter Jeremy <peter@rulingia.com>, Gleb Smirnoff <glebius@freebsd.org>
Cc: freebsd-gnats-submit <FreeBSD-gnats-submit@freebsd.org>
Subject: Re: kern/185395: IPv4 Multicast broken in 10.x
Date: Wed, 1 Jan 2014 22:03:36 +0100

 --047d7b86db46eafcdb04eeef03ad
 Content-Type: text/plain; charset=ISO-8859-1
 
 On Wed, Jan 1, 2014 at 8:33 PM, Peter Jeremy <peter@rulingia.com> wrote:
 
 >
 > >Description:
 >         IPv4 multicast ethernet frames use the IP address of the default
 >         route in the destination MAC address, instead of the IP address of
 >         the multicast destination.  This breaks multicast filtering at the
 >         receiver.
 >
 >         This is a regression from FreeBSD 9.2.
 >
 > >Fix:
 >         Unknown.  The cause isn't obvious from a cursory look at the 9.x
 >         and 10.x code.
 >
 
 And what about the commit 249925 "Add const qualifier to the dst parameter
 of the ifnet if_output method" (Fri Apr 26 12:50:32 2013 UTC) ?
 
 This commit modify function arpresolve() in sys/netinet/if_ether.c by
 replacing:
 arpresolve(...,struct sockaddr *dst, ...)
 by
 arpresolve(...,const struct sockaddr *dst, ...).
 
 And inside this function there is a call to this macro:
 ETHER_MAP_IP_MULTICAST(&SIN(dst)->sin_addr, desten);
 
 => If the 'structure dst' in now a 'const struct dst', can the struct 'dst'
 still be modified by the macro ??
 (I'm learning C, and don't understand this complex code).
 
 Regards,
 
 Olivier
 
 --047d7b86db46eafcdb04eeef03ad
 Content-Type: text/html; charset=ISO-8859-1
 Content-Transfer-Encoding: quoted-printable
 
 <div dir=3D"ltr"><div class=3D"gmail_extra"><div class=3D"gmail_quote">On W=
 ed, Jan 1, 2014 at 8:33 PM, Peter Jeremy <span dir=3D"ltr">&lt;<a href=3D"m=
 ailto:peter@rulingia.com" target=3D"_blank">peter@rulingia.com</a>&gt;</spa=
 n> wrote:<br>
 
 <blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-=
 left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;p=
 adding-left:1ex"><br>
 &gt;Description:<br>
 =A0 =A0 =A0 =A0 IPv4 multicast ethernet frames use the IP address of the de=
 fault<br>
 =A0 =A0 =A0 =A0 route in the destination MAC address, instead of the IP add=
 ress of<br>
 =A0 =A0 =A0 =A0 the multicast destination. =A0This breaks multicast filteri=
 ng at the<br>
 =A0 =A0 =A0 =A0 receiver.<br>
 <br>
 =A0 =A0 =A0 =A0 This is a regression from FreeBSD 9.2.<br><br>
 &gt;Fix:<br>
 =A0 =A0 =A0 =A0 Unknown. =A0The cause isn&#39;t obvious from a cursory look=
  at the 9.x<br>
 =A0 =A0 =A0 =A0 and 10.x code.<br></blockquote><div><br></div><div>And what=
  about the commit 249925 &quot;Add const qualifier to the dst parameter of =
 the ifnet if_output method&quot; (Fri Apr 26 12:50:32 2013 UTC) ?<br></div>=
 <div>
 
 <br></div><div>This commit modify function arpresolve() in sys/netinet/if_e=
 ther.c by replacing:</div><div>arpresolve(...,struct sockaddr *dst, ...)</d=
 iv><div>by</div><div>arpresolve(...,const struct sockaddr *dst, ...).<br>
 
 </div><div><br></div><div>And inside this function there is a call to this =
 macro:<br></div><div>ETHER_MAP_IP_MULTICAST(&amp;SIN(dst)-&gt;sin_addr, des=
 ten);<br></div><div><br></div><div>=3D&gt; If the &#39;structure dst&#39; i=
 n now a &#39;const struct dst&#39;, can the struct &#39;dst&#39; still be m=
 odified by the macro ??</div>
 
 <div>(I&#39;m learning C, and don&#39;t understand this complex code).</div=
 ><div><br></div><div>Regards,</div><div><br></div><div>Olivier</div></div><=
 /div></div>
 
 --047d7b86db46eafcdb04eeef03ad--

From: Peter Jeremy <peter@rulingia.com>
To: Olivier =?iso-8859-1?Q?Cochard-Labb=E9?= <olivier@cochard.me>
Cc: freebsd-gnats-submit <FreeBSD-gnats-submit@freebsd.org>
Subject: Re: kern/185395: IPv4 Multicast broken in 10.x
Date: Thu, 2 Jan 2014 17:47:56 +1100

 --s9fJI615cBHmzTOP
 Content-Type: text/plain; charset=iso-8859-1
 Content-Disposition: inline
 Content-Transfer-Encoding: quoted-printable
 
 On 2014-Jan-01 22:03:36 +0100, Olivier Cochard-Labb=E9 <olivier@cochard.me>=
  wrote:
 >And what about the commit 249925 "Add const qualifier to the dst parameter
 >of the ifnet if_output method" (Fri Apr 26 12:50:32 2013 UTC) ?
 >
 >This commit modify function arpresolve() in sys/netinet/if_ether.c by
 >replacing:
 >arpresolve(...,struct sockaddr *dst, ...)
 >by
 >arpresolve(...,const struct sockaddr *dst, ...).
 >
 >And inside this function there is a call to this macro:
 >ETHER_MAP_IP_MULTICAST(&SIN(dst)->sin_addr, desten);
 
 ETHER_MAP_IP_MULTICAST does left to right assignment - the first argument is
 only read so this change doesn't affect anything.
 
 >=3D> If the 'structure dst' in now a 'const struct dst', can the struct 'd=
 st'
 >still be modified by the macro ??
 
 The macro never modified 'dst'.  In any case, the compiler tracks 'const'
 and would raise a compile-time error if something tried to modify dst.
 
 --=20
 Peter Jeremy
 
 --s9fJI615cBHmzTOP
 Content-Type: application/pgp-signature
 
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2.0.22 (FreeBSD)
 
 iKYEARECAGYFAlLFC5xfFIAAAAAALgAoaXNzdWVyLWZwckBub3RhdGlvbnMub3Bl
 bnBncC5maWZ0aGhvcnNlbWFuLm5ldDBCRjc3QTcyNTg5NEVCRTY0RjREN0VFRUZF
 OEE0N0JGRjAwRkI4ODcACgkQ/opHv/APuIeGJQCgrnnT3SfB+/6uk0lDzXhIBjfm
 jOEAoL9KLPmZUm3vuTu+V4oUEkMoBysl
 =vVA+
 -----END PGP SIGNATURE-----
 
 --s9fJI615cBHmzTOP--
State-Changed-From-To: open->patched 
State-Changed-By: glebius 
State-Changed-When: Thu Jan 2 10:18:56 UTC 2014 
State-Changed-Why:  
Fixed in head. 


Responsible-Changed-From-To: freebsd-bugs->glebius 
Responsible-Changed-By: glebius 
Responsible-Changed-When: Thu Jan 2 10:18:56 UTC 2014 
Responsible-Changed-Why:  
Fixed in head. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=185395 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: kern/185395: commit references a PR
Date: Thu,  2 Jan 2014 10:18:52 +0000 (UTC)

 Author: glebius
 Date: Thu Jan  2 10:18:39 2014
 New Revision: 260188
 URL: http://svnweb.freebsd.org/changeset/base/260188
 
 Log:
   Fix regression from r249894. Now we pass "gw" as argument to if_output
   method, thus for multicast case we need it to point at "dst".
   
   PR:		185395
   Submitted by:	ae
 
 Modified:
   head/sys/netinet/ip_output.c
 
 Modified: head/sys/netinet/ip_output.c
 ==============================================================================
 --- head/sys/netinet/ip_output.c	Thu Jan  2 08:40:37 2014	(r260187)
 +++ head/sys/netinet/ip_output.c	Thu Jan  2 10:18:39 2014	(r260188)
 @@ -333,6 +333,12 @@ again:
  	if (IN_MULTICAST(ntohl(ip->ip_dst.s_addr))) {
  		m->m_flags |= M_MCAST;
  		/*
 +		 * IP destination address is multicast.  Make sure "gw"
 +		 * still points to the address in "ro".  (It may have been
 +		 * changed to point to a gateway address, above.)
 +		 */
 +		gw = dst;
 +		/*
  		 * See if the caller provided any multicast options
  		 */
  		if (imo != NULL) {
 _______________________________________________
 svn-src-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/svn-src-all
 To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"
 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: kern/185395: commit references a PR
Date: Sun,  5 Jan 2014 13:56:24 +0000 (UTC)

 Author: glebius
 Date: Sun Jan  5 13:55:33 2014
 New Revision: 260319
 URL: http://svnweb.freebsd.org/changeset/base/260319
 
 Log:
   Merge r260188 from head:
     Fix regression from r249894. Now we pass "gw" as argument to if_output
     method, thus for multicast case we need it to point at "dst".
   
   PR:		185395
 
 Modified:
   stable/10/sys/netinet/ip_output.c
 Directory Properties:
   stable/10/   (props changed)
 
 Modified: stable/10/sys/netinet/ip_output.c
 ==============================================================================
 --- stable/10/sys/netinet/ip_output.c	Sun Jan  5 11:58:07 2014	(r260318)
 +++ stable/10/sys/netinet/ip_output.c	Sun Jan  5 13:55:33 2014	(r260319)
 @@ -331,6 +331,12 @@ again:
  	if (IN_MULTICAST(ntohl(ip->ip_dst.s_addr))) {
  		m->m_flags |= M_MCAST;
  		/*
 +		 * IP destination address is multicast.  Make sure "gw"
 +		 * still points to the address in "ro".  (It may have been
 +		 * changed to point to a gateway address, above.)
 +		 */
 +		gw = dst;
 +		/*
  		 * See if the caller provided any multicast options
  		 */
  		if (imo != NULL) {
 _______________________________________________
 svn-src-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/svn-src-all
 To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"
 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: kern/185395: commit references a PR
Date: Mon,  6 Jan 2014 19:14:54 +0000 (UTC)

 Author: glebius
 Date: Mon Jan  6 19:14:46 2014
 New Revision: 260378
 URL: http://svnweb.freebsd.org/changeset/base/260378
 
 Log:
   Merge r260319 from stable/10 (r260188 from head):
   
     Fix regression from r249894. Now we pass "gw" as argument to if_output
     method, thus for multicast case we need it to point at "dst".
   
   PR:		185395
   Approved by:	re (gjb)
 
 Modified:
   releng/10.0/sys/netinet/ip_output.c
 Directory Properties:
   releng/10.0/   (props changed)
 
 Modified: releng/10.0/sys/netinet/ip_output.c
 ==============================================================================
 --- releng/10.0/sys/netinet/ip_output.c	Mon Jan  6 19:05:04 2014	(r260377)
 +++ releng/10.0/sys/netinet/ip_output.c	Mon Jan  6 19:14:46 2014	(r260378)
 @@ -331,6 +331,12 @@ again:
  	if (IN_MULTICAST(ntohl(ip->ip_dst.s_addr))) {
  		m->m_flags |= M_MCAST;
  		/*
 +		 * IP destination address is multicast.  Make sure "gw"
 +		 * still points to the address in "ro".  (It may have been
 +		 * changed to point to a gateway address, above.)
 +		 */
 +		gw = dst;
 +		/*
  		 * See if the caller provided any multicast options
  		 */
  		if (imo != NULL) {
 _______________________________________________
 svn-src-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/svn-src-all
 To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"
 
State-Changed-From-To: patched->closed 
State-Changed-By: glebius 
State-Changed-When: Wed Jan 22 10:13:45 UTC 2014 
State-Changed-Why:  
Fix merged and got to 10.0-RELEASE. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=185395 
>Unformatted:
