From owner-freebsd-net@FreeBSD.ORG Fri Aug 22 16:42:52 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 B4EA4106564A; Fri, 22 Aug 2008 16:42:52 +0000 (UTC) (envelope-from sam@freebsd.org) Received: from ebb.errno.com (ebb.errno.com [69.12.149.25]) by mx1.freebsd.org (Postfix) with ESMTP id 845318FC0A; Fri, 22 Aug 2008 16:42:52 +0000 (UTC) (envelope-from sam@freebsd.org) Received: from trouble.errno.com (trouble.errno.com [10.0.0.248]) (authenticated bits=0) by ebb.errno.com (8.13.6/8.12.6) with ESMTP id m7MGRPWU094848 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 22 Aug 2008 09:27:25 -0700 (PDT) (envelope-from sam@freebsd.org) Message-ID: <48AEE8ED.7000301@freebsd.org> Date: Fri, 22 Aug 2008 09:27:25 -0700 From: Sam Leffler Organization: FreeBSD Project User-Agent: Thunderbird 2.0.0.9 (X11/20071125) MIME-Version: 1.0 To: Luigi Rizzo References: <20080821203519.GA51534@onelab2.iet.unipi.it> <48AE23FF.9070009@FreeBSD.org> <20080822083020.GA57441@onelab2.iet.unipi.it> In-Reply-To: <20080822083020.GA57441@onelab2.iet.unipi.it> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-DCC--Metrics: ebb.errno.com; whitelist Cc: gnn@freebsd.org, "Bruce M. Simpson" , 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 16:42:52 -0000 Luigi Rizzo wrote: > 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. > > I agree that doing the deep copy is just papering over a bigger problem. Sam