cvs commit: src/sys/kern uipc_mbuf.c src/sys/netinetip_output.c src/sys/sys mbuf.h

Mike Silbersack silby at silby.com
Sun Aug 31 23:02:48 PDT 2003


On Sun, 31 Aug 2003, Mike Silbersack wrote:

>   - Fragmentation is handled by the function m_fragment, which can
>   be called from whereever fragmentation is needed.  Note that this
>   function is wrapped in #ifdef MBUF_STRESS_TEST to discourage non-testing
>   use.

Note that I #ifdef'd the function, but I left the definition in mbuf.h
without any #ifdefs around it, because that seemed evil.  If there's a
more correct way of handling this, please tell me.

>   - Add two modes of random fragmentation.  Chains with fragments all of
>   the same random length and chains with fragments that are each uniquely
>   random in length may now be requested.

While testing this feature, I came to the conclusion that arc4random must
be somewhat statistically random, as I was using arc4random & 255, and
chain lengths seemed to be coming up about 11 frags in length.

(256 / 2) = 128 * 11 = 1408, which is pretty close to the length of an
ethernet packet.  Not very scientific, but interesting.  (I was watching
via a ppsratelimited check on the chainlength, and didn't write down exact
results either, so it's actually totally unscientific.)

Mike "Silby" Silbersack


More information about the cvs-src mailing list