Subject: Re: CVS commit: src/sys
To: None <tech-net@netbsd.org>
From: Matthias Scheler <tron@zhadum.de>
List: tech-net
Date: 06/02/2005 14:39:59
On Thu, Jun 02, 2005 at 10:29:34PM +0900, YAMAMOTO Takashi wrote:
> > Log Message:
> > Change the first argument of m_copydata() to "const struct mbuf *" (which
> > doesn't require any implementation changes). This will allow us to get
> > rid off a lot of nasty type casts.
> please don't.

I was necessary to fix build problems in at least stf(4) and probably
also gif(4) (my kernel build died in "in_stf.c")/

> in general, constness of a structure is not the same as
> logical constness of the data described by it.

Yes, I know. But m_copydata() changes neither of those.

> i'm working on lazy mbuf mapping and it sometimes modify
> mbufs in m_copydata.

That would be wrong anyway because m_copydata() is used in locations of
the code which aren't allowed to modify the mbuf (e.g. in the tunnel
interface pseudo drivers, see above). Wouldn't it be better to invent
a new function for your purpose?

	Kind regards

-- 
Matthias Scheler                                  http://scheler.de/~matthias/