Subject: Re: CMSG_ALIGN
To: None <tech-net@netbsd.org>
From: der Mouse <mouse@Rodents.Montreal.QC.CA>
List: tech-net
Date: 06/28/2003 00:36:52
> and the kernel does not know what kind of alignment userland have
> used!

But - since this is all a hypothetical assuming that the padding is
counted into cmsg_len - it can find out, by looking at the cmsg_len
values.

>> If userland doesn't align it to whatever alignment the kernel wants,
>> the kernel should copy it.
> so the kernel cannot copy like you suggested here.

I'm not sure what you're saying here.  You must have forgotten that
this is all about counting padding into cmsg_len; you're too good at
what you do for me to account for it any other way.

If you still doubt, I can write up sample code that converts a control
data stream such as I have been suggesting into an mbuf chain with each
item in a separate mbuf, such as ip_savecontrol might generate in the
other direction.

> by using __cmsg_alignbytes() userland and kernel can share the align
> constraint easily and the problem goes away.

...to be replaced by a different problem.

However, you seem so determined to miss that point that I see no reason
I should continue to repeat it.

/~\ The ASCII				der Mouse
\ / Ribbon Campaign
 X  Against HTML	       mouse@rodents.montreal.qc.ca
/ \ Email!	     7D C8 61 52 5D E7 2D 39  4E F1 31 3E E8 B3 27 4B