Subject: Re: cleaning up the rest of dtom()
To: enami tsugutomo <enami@ba2.so-net.or.jp>
From: Jason Thorpe <thorpej@nas.nasa.gov>
List: tech-kern
Date: 06/24/1997 17:05:56
On 25 Jun 1997 07:53:59 +0900 
 enami tsugutomo <enami@ba2.so-net.or.jp> wrote:

 > Yes, so, I want to say that following test (which comes after NDINIT
 > above example) now becomes always false...
 > 
 > 	if (nam->m_data + nam->m_len == &nam->m_dat[MLEN]) {	/* XXX */

...that is correct... this test would always be false... I can (and
probably should) be eliminated.

 > Or is there any arch on which mbuf length is less than 128 byte?  Hmm,
 > or is there arch on which sizeof sockaddr_un becomes 108 byte by some
 > alignment matter...?

Ok... On a 32-bit arch, sizeof(struct m_hdr) == 24 (I don't see any
cases where the compiler might pad it out).  If MSIZE == 128, that means
that MLEN == 104.  _Already_ it's too small for a sockaddr_un!  sockargs()
has some kludges in it for "COMPAT_OLDSOCK" ... A sockaddr_un should
only be 106 bytes, not 108 ... According to the Alpha, SPARC, and i386
compilers, anyhow...

After discussing this with Charles Hannum, an obvious way to cheat would
be to MEXTMALLOC() enough external storage to hold the data in sockargs(),
etc.

Jason R. Thorpe                                       thorpej@nas.nasa.gov
NASA Ames Research Center                               Home: 408.866.1912
NAS: M/S 258-6                                          Work: 415.604.0935
Moffett Field, CA 94035                                Pager: 415.428.6939