Subject: Re: CMSG_ALIGN
To: der Mouse <mouse@Rodents.Montreal.QC.CA>
From: None <itojun@iijlab.net>
List: tech-net
Date: 06/28/2003 09:12:08
>>>>> Why not, instead, have the kernel increase the cmsg_len values to
>>>>> whatever boundary it thinks appropriate?
>> cmsg is bidirectional.  when userland passes cmsg to kernel, we can
>> not do such trick (userland does not know what kind of alignment
>> kernel wants), so __cmsg_alignbytes is there for you.
>
>Yessss...but should the kernel be counting on userland to do any
>alignment?  IMO it shouldn't be; it should be obeying cmsg_len values
>and, if the value isn't aligned the way it (the kernel) wants, copying.
>Again, no need for CMSG_ALIGN.

	then, how the kernel know the alignment constraint userland have used?
	there's no way to tell, as cmsg_len() does not include padding
	(see RFC2292 page 19 for diagram)

itojun