From owner-freebsd-net@FreeBSD.ORG Fri Aug 22 08:27:47 2008 Return-Path: Delivered-To: net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0D0AB1065682; Fri, 22 Aug 2008 08:27:47 +0000 (UTC) (envelope-from luigi@onelab2.iet.unipi.it) Received: from onelab2.iet.unipi.it (onelab2.iet.unipi.it [131.114.9.129]) by mx1.freebsd.org (Postfix) with ESMTP id C1EB28FC12; Fri, 22 Aug 2008 08:27:46 +0000 (UTC) (envelope-from luigi@onelab2.iet.unipi.it) Received: by onelab2.iet.unipi.it (Postfix, from userid 275) id 3BE6C7308B; Fri, 22 Aug 2008 10:30:20 +0200 (CEST) Date: Fri, 22 Aug 2008 10:30:20 +0200 From: Luigi Rizzo To: "Bruce M. Simpson" Message-ID: <20080822083020.GA57441@onelab2.iet.unipi.it> References: <20080821203519.GA51534@onelab2.iet.unipi.it> <48AE23FF.9070009@FreeBSD.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <48AE23FF.9070009@FreeBSD.org> User-Agent: Mutt/1.4.2.3i Cc: gnn@freebsd.org, net@freebsd.org Subject: Re: Small patch to multicast code... X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Aug 2008 08:27:47 -0000 On Fri, Aug 22, 2008 at 03:27:11AM +0100, Bruce M. Simpson wrote: > gnn@freebsd.org wrote: > >>The only thing i can think of is that it's the UDP checksum, > >>residing beyond hlen, which is overwritten somewhere in the > >>call to if_simloop -- in which case perhaps a better fix is > >>to m_pullup() the udp header as well ? > >> > > > >It is the checksum that gets trashed, yes. > >... > >The m_*() routines actually have reasonable comments, it just seems > >the wrong one was used here. > > > > Actually, m_copy() has been legacy for some time now -- see comments. The API is undocumented, but in this specific function the reason for using one rather than the other is undocumented. Especially, if you use m_dup() then the call to m_pullup should be unnecessary. That's why I suggested to explain clearly what is wrong in the original code, so even if now we only apply a temporary bandaid (for lack of time, etc.) hopefully later this can be reverted to something more efficient such as pulling up the UDP header as well. cheers luigi