Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 23 May 2002 16:39:27 -0400 (EDT)
From:      Rob Manchester <rmanches@brown.edu>
To:        FreeBSD-gnats-submit@FreeBSD.org
Subject:   kern/38473: src address in ipv4 hdr for multicast packets contain hosts group rather than hosts address
Message-ID:  <200205232039.g4NKdRLM005572@lester.manchero.org>

next in thread | raw e-mail | index | archive | help

>Number:         38473
>Category:       kern
>Synopsis:       src address in ipv4 hdr for multicast packets contain hosts group rather than hosts address
>Confidential:   no
>Severity:       critical
>Priority:       high
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu May 23 16:50:01 PDT 2002
>Closed-Date:
>Last-Modified:
>Originator:     Rob Manchester
>Release:        FreeBSD 4.6-RC i386
>Organization:
>Environment:
System: FreeBSD lester 4.6-RC FreeBSD 4.6-RC #21: Sat May 18 17:02:34 EDT 2002 rmanches@lester:/usr/obj/usr/src/sys/LESTER i386


>Description:
	according to section 6.2 of rfc1054, the source address in the
	ip header should contain the host's address rather than the host's
	group address.  FreeBSD from at least 4.5->4.6rc sets the source
	address to the host group.  I don't see a reason for doing this,
	and it causes incompatibility with other os's ipv4 mc
	implementaion, mainly linux.

>How-To-Repeat:

	send out a mc packet using ipv4 and watch the outgoing packets
	using tcpdump.

>Fix:

if the src address is a multicast addres, set the address to that of the
outgoing interface.

Index: ip_output.c
===================================================================
RCS file: /home/ncvs/src/sys/netinet/ip_output.c,v
retrieving revision 1.157
diff -u -r1.157 ip_output.c
--- ip_output.c	2002/05/21 18:52:24	1.157
+++ ip_output.c	2002/05/23 01:31:09
@@ -316,10 +316,11 @@
 			}
 		}
 		/*
-		 * If source address not specified yet, use address
-		 * of outgoing interface.
+		 * If source address not specified yet, or it is a mc
+		 * address, use the address of outgoing interface
 		 */
-		if (ip->ip_src.s_addr == INADDR_ANY) {
+		if (ip->ip_src.s_addr == INADDR_ANY ||
+			IN_MULTICAST(ntohl(ip->ip_src.s_addr))) {
 			/* Interface may have no addresses. */
 			if (ia != NULL)
 				ip->ip_src = IA_SIN(ia)->sin_addr;
>Release-Note:
>Audit-Trail:
>Unformatted:

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message




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