From owner-cvs-all Wed Dec 1 16:22:12 1999 Delivered-To: cvs-all@freebsd.org Received: from bubba.whistle.com (bubba.whistle.com [207.76.205.7]) by hub.freebsd.org (Postfix) with ESMTP id 6114514BDB; Wed, 1 Dec 1999 16:22:09 -0800 (PST) (envelope-from archie@whistle.com) Received: (from archie@localhost) by bubba.whistle.com (8.9.2/8.9.2) id QAA45321; Wed, 1 Dec 1999 16:21:36 -0800 (PST) From: Archie Cobbs Message-Id: <199912020021.QAA45321@bubba.whistle.com> Subject: Re: cvs commit: src/sys/kern uipc_mbuf.c src/sys/sys mbuf.h In-Reply-To: <199912020006.RAA45585@panzer.kdm.org> from "Kenneth D. Merry" at "Dec 1, 1999 05:06:35 pm" To: ken@kdm.org (Kenneth D. Merry) Date: Wed, 1 Dec 1999 16:21:36 -0800 (PST) Cc: julian@whistle.com (Julian Elischer), archie@whistle.com (Archie Cobbs), gibbs@FreeBSD.org (Justin T. Gibbs), cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org X-Mailer: ELM [version 2.4ME+ PL54 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk Kenneth D. Merry writes: > > > Basically all it does is create a completely new mbuf chain containing > > > the same data as the original. Definitely at least 1 copy :-) > > > > > > You rarely need this, but 'ipfw tee' is one of those cases. > > I take it you need both copies to be writeable in that case? What are you > writing to the copy? Imagine the following scenario: you copy a packet for debug purposes at some point in the kernel traffic flow. Then the original packet, later on, has its header stripped off and another one put on (say, going from Ethernet to ATM). This can happen all in the same mbuf data area. Then, the recipient of the debug copy reads the packet. She will see the ATM header instead of the Ethernet header... which is presumably not what she was expecting. This happens with 'ipfw tee' because div_input() must modify the packet in order to put some of the IP header fields back in network order (because ip_input() reverses them first). -Archie ___________________________________________________________________________ Archie Cobbs * Whistle Communications, Inc. * http://www.whistle.com To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message