From owner-freebsd-arch Wed Sep 18 10:30:46 2002 Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 4CFE337B401 for ; Wed, 18 Sep 2002 10:30:45 -0700 (PDT) Received: from critter.freebsd.dk (critter.freebsd.dk [212.242.86.163]) by mx1.FreeBSD.org (Postfix) with ESMTP id 48E8143E6A for ; Wed, 18 Sep 2002 10:30:44 -0700 (PDT) (envelope-from phk@critter.freebsd.dk) Received: from critter.freebsd.dk (localhost [127.0.0.1]) by critter.freebsd.dk (8.12.6/8.12.6) with ESMTP id g8IHUgtF004749; Wed, 18 Sep 2002 19:30:42 +0200 (CEST) (envelope-from phk@critter.freebsd.dk) To: Bosko Milekic Cc: arch@freebsd.org Subject: Re: Trivial mbuf patch for review. In-Reply-To: Your message of "Wed, 18 Sep 2002 13:23:00 EDT." <20020918132300.A34069@unixdaemons.com> Date: Wed, 18 Sep 2002 19:30:42 +0200 Message-ID: <4748.1032370242@critter.freebsd.dk> From: Poul-Henning Kamp Sender: owner-freebsd-arch@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG In message <20020918132300.A34069@unixdaemons.com>, Bosko Milekic writes: >> panic("sbappendcontrol"); >> - for (m = control; ; m = m->m_next) { >> - space += m->m_len; >> - if (m->m_next == 0) >> - break; >> - } >> - n = m; /* save pointer to last control buffer */ >> - for (m = m0; m; m = m->m_next) >> - space += m->m_len; >> + space = m_length(control, &n) + m_length(m0, NULL); >> if (space > sbspace(sb)) >> return (0); >> n->m_next = m0; /* concatenate data to control */ > > Looks like there is a problem here, as you removed the 'n = m' > initialization. m_length's returns the pointer to the last mbuf in the chain in the second argument, so n should have the same value as before. -- Poul-Henning Kamp | UNIX since Zilog Zeus 3.20 phk@FreeBSD.ORG | TCP/IP since RFC 956 FreeBSD committer | BSD since 4.3-tahoe Never attribute to malice what can adequately be explained by incompetence. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-arch" in the body of the message