From owner-freebsd-net@FreeBSD.ORG Tue Feb 22 05:08:08 2005 Return-Path: <owner-freebsd-net@FreeBSD.ORG> Delivered-To: freebsd-net@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 5737A16A4CE for <freebsd-net@freebsd.org>; Tue, 22 Feb 2005 05:08:08 +0000 (GMT) Received: from mail-svr1.cs.utah.edu (mail-svr1.cs.utah.edu [155.98.64.200]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1C9F643D53 for <freebsd-net@freebsd.org>; Tue, 22 Feb 2005 05:08:08 +0000 (GMT) (envelope-from swami@cs.utah.edu) Received: from localhost (localhost [127.0.0.1]) by mail-svr1.cs.utah.edu (Postfix) with ESMTP id DCD3C346D9 for <freebsd-net@freebsd.org>; Mon, 21 Feb 2005 22:08:07 -0700 (MST) Received: from mail-svr1.cs.utah.edu ([127.0.0.1]) by localhost (mail-svr1.cs.utah.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 08914-07 for <freebsd-net@freebsd.org>; Mon, 21 Feb 2005 22:08:07 -0700 (MST) Received: from blanc.cs.utah.edu (blanc.cs.utah.edu [155.98.71.201]) by mail-svr1.cs.utah.edu (Postfix) with ESMTP id 9C161346D3 for <freebsd-net@freebsd.org>; Mon, 21 Feb 2005 22:08:07 -0700 (MST) Received: by blanc.cs.utah.edu (Postfix, from userid 4970) id 8060A3F72; Mon, 21 Feb 2005 22:08:07 -0700 (MST) Received: from localhost (localhost [127.0.0.1]) by blanc.cs.utah.edu (Postfix) with ESMTP id 6DA213F70 for <freebsd-net@freebsd.org>; Mon, 21 Feb 2005 22:08:07 -0700 (MST) Date: Mon, 21 Feb 2005 22:08:07 -0700 (MST) From: Swami Pichumani <swami@cs.utah.edu> To: freebsd-net@freebsd.org Message-ID: <Pine.LNX.4.61.0502212207150.8297@blanc.cs.utah.edu> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Virus-Scanned: amavisd-new at cs.utah.edu Subject: question on mbuf(m_copyback) code X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Networking and TCP/IP with FreeBSD <freebsd-net.freebsd.org> List-Unsubscribe: <http://lists.freebsd.org/mailman/listinfo/freebsd-net>, <mailto:freebsd-net-request@freebsd.org?subject=unsubscribe> List-Archive: <http://lists.freebsd.org/pipermail/freebsd-net> List-Post: <mailto:freebsd-net@freebsd.org> List-Help: <mailto:freebsd-net-request@freebsd.org?subject=help> List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/freebsd-net>, <mailto:freebsd-net-request@freebsd.org?subject=subscribe> X-List-Received-Date: Tue, 22 Feb 2005 05:08:08 -0000 Hi all, I had a question on the m_copyback code (I use pretty old version but feel this might still be same). Inside the while(len>0) loop, the first line kinda seems odd. It subtracts the off (which becomes after first iteration) from m_len(which is supposed to tell the amount of data in the particular mbuf) to find the free space i nthe mbuf. This obviously would not work without m_len getting initialized to MLEN (or MHLEN), which is not the right thing to do (since when an mbuf has 0 data when initialized and m_len would be zero). thanks in advance for any comments on this, -swami