Subject: Re: Making counts and lengths unsigned
To: Thor Lancelot Simon <tls@rek.tjls.com>
From: Charles M. Hannum <mycroft@MIT.EDU>
List: tech-kern
Date: 04/14/2006 12:58:45
On Thu, Apr 13, 2006 at 10:16:59PM -0400, Thor Lancelot Simon wrote:
> As far as I can tell there is no code in our system that ever
> assigns a negative value to m.len or buf.b_bcount; and there is
> certainly code that would severely misbehave if it ever encountered
> a buf in that state (I am not familiar enough with the network
> code to be able to say the same thing about an mbuf).  Does anyone
> have any compelling reason why I should _not_ do this?

There are places where arithmetic is done with m_len and a signed
(possibly negative) value.  This would have to be done with extreme
care -- just switching the type is very likely to introduce bugs.