Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 27 Aug 2000 20:17:48 -0400 (EDT)
From:      Garrett Wollman <wollman@khavrinen.lcs.mit.edu>
To:        Archie Cobbs <archie@whistle.com>
Cc:        freebsd-net@FreeBSD.ORG, freebsd-current@FreeBSD.ORG
Subject:   Proposal to clarify mbuf handling rules
Message-ID:  <200008280017.UAA21141@khavrinen.lcs.mit.edu>
In-Reply-To: <200008272125.OAA66159@bubba.whistle.com>
References:  <200008272125.OAA66159@bubba.whistle.com>

next in thread | previous in thread | raw e-mail | index | archive | help
<<On Sun, 27 Aug 2000 14:25:55 -0700 (PDT), Archie Cobbs <archie@whistle.com> said:

> However, many routines that take an mbuf parameter assume that the
> mbuf given to them is modifiable and proceed to write all over it.

s/assume/require as a necessary precondition/

It's not a coding error, it's part of the specification.  No, it's not
documented -- but it's pretty clear from the design of the original
code.

>   3.  For any routines that do need to modify mbuf data, but don't
>       assume anything about the mbuf, alter those routines to do
>       an m_pullup() when necessary to make the data are they are
>       working on modifiable.

m_pullup is evil.  It would be better to fix the places (i.e.,
ip_input and ip_output) which make the modification necessary.

-GAWollman

--
Garrett A. Wollman   | O Siem / We are all family / O Siem / We're all the same
wollman@lcs.mit.edu  | O Siem / The fires of freedom 
Opinions not those of| Dance in the burning flame
MIT, LCS, CRS, or NSA|                     - Susan Aglukark and Chad Irschick


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-net" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200008280017.UAA21141>