From owner-freebsd-bugs Thu May 23 16:50:16 2002 Delivered-To: freebsd-bugs@hub.freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id E232837B406 for ; Thu, 23 May 2002 16:50:01 -0700 (PDT) Received: (from gnats@localhost) by freefall.freebsd.org (8.11.6/8.11.6) id g4NNo1u24850; Thu, 23 May 2002 16:50:01 -0700 (PDT) (envelope-from gnats) Received: from cable2-228.fctvplus.net (cable2-228.fctvplus.net [63.85.56.228]) by hub.freebsd.org (Postfix) with ESMTP id E4EE637B40A for ; Thu, 23 May 2002 16:42:21 -0700 (PDT) Received: from lester.manchero.org (localhost [127.0.0.1]) by cable2-228.fctvplus.net (8.12.3/8.12.3) with ESMTP id g4NKdRt3005573 for ; Thu, 23 May 2002 16:39:27 -0400 (EDT) (envelope-from rmanches@lester.manchero.org) Received: (from rmanches@localhost) by lester.manchero.org (8.12.3/8.12.3/Submit) id g4NKdRLM005572; Thu, 23 May 2002 16:39:27 -0400 (EDT) Message-Id: <200205232039.g4NKdRLM005572@lester.manchero.org> Date: Thu, 23 May 2002 16:39:27 -0400 (EDT) From: Rob Manchester Reply-To: Rob Manchester To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Subject: kern/38473: src address in ipv4 hdr for multicast packets contain hosts group rather than hosts address Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org >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