From owner-freebsd-current Mon Feb 24 11:46:20 2003 Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id A624337B401 for ; Mon, 24 Feb 2003 11:46:19 -0800 (PST) Received: from mailhub.fokus.gmd.de (mailhub.fokus.gmd.de [193.174.154.14]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4E08143F93 for ; Mon, 24 Feb 2003 11:46:18 -0800 (PST) (envelope-from brandt@fokus.fraunhofer.de) Received: from beagle (beagle [193.175.132.100]) by mailhub.fokus.gmd.de (8.11.6/8.11.6) with ESMTP id h1OJkDl08936; Mon, 24 Feb 2003 20:46:13 +0100 (MET) Date: Mon, 24 Feb 2003 20:46:13 +0100 (CET) From: Harti Brandt X-X-Sender: hbb@beagle.fokus.gmd.de To: Hiten Pandya Cc: Craig Rodrigues , freebsd-current@FreeBSD.ORG Subject: Re: Problem with M_COPY_PACKET In-Reply-To: <20030224191824.GA52283@unixdaemons.com> Message-ID: <20030224204521.G54577@beagle.fokus.gmd.de> References: <20030224170702.GA1059@attbi.com> <20030224191824.GA52283@unixdaemons.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Mon, 24 Feb 2003, Hiten Pandya wrote: HP>Craig Rodrigues (Mon, Feb 24, 2003 at 12:07:02PM -0500) wrote: HP>> The code in question looks like: HP>> ========================================================================= HP>> struct mbuf * HP>> copy_mbuf(struct mbuf *m) HP>> { HP>> struct mbuf *new; HP>> HP>> MGET(new, M_DONTWAIT, MT_DATA); HP>> if(new == NULL) HP>> return NULL; HP>> if(m->m_flags & M_PKTHDR) HP>> M_COPY_PKTHDR(new, m); HP> HP>What you need, is m_dup_pkthdr(). M_COPY_PKTHDR has been HP>deprecated for several reasons, that are outlined in the HP>commit log of rev. 1.109 of sys/sys/mbuf.h. I wrote that code. It must be a M_MOVE_PKTHDR, because m is just disposed afterwards. harti -- harti brandt, http://www.fokus.gmd.de/research/cc/cats/employees/hartmut.brandt/private brandt@fokus.fraunhofer.de, harti@freebsd.org To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message