netdev
[Top] [All Lists]

Re: socklen_t instead of size_t in struct cmsghdr

To: jakub@xxxxxxxxxx
Subject: Re: socklen_t instead of size_t in struct cmsghdr
From: "David S. Miller" <davem@xxxxxxxxxx>
Date: Wed, 4 Oct 2000 01:31:17 -0700
Cc: kuznet@xxxxxxxxxxxxx, jakub@xxxxxxxxxx, ak@xxxxxx, netdev@xxxxxxxxxxx
In-reply-to: <20001002220155.P9588@xxxxxxxxxxxxxxxxxxxxxx> (message from Jakub Jelinek on Mon, 2 Oct 2000 22:01:55 +0200)
References: <20001002120349.L9588@xxxxxxxxxxxxxxxxxxxxxx> <200010021932.XAA25328@xxxxxxxxxxxxx> <20001002220155.P9588@xxxxxxxxxxxxxxxxxxxxxx>
Sender: owner-netdev@xxxxxxxxxxx
   Date: Mon, 2 Oct 2000 22:01:55 +0200
   From: Jakub Jelinek <jakub@xxxxxxxxxx>

   On Mon, Oct 02, 2000 at 11:32:42PM +0400, kuznet@xxxxxxxxxxxxx wrote:
   > cmsghdr is aligned differently on 64bit and 32bit architectures,
   > so that you have to do real convertor for ultra in any case. :-(

   Yes, but the different alignment is because of the 64bit type in struct
   cmsghdr.

Not completely, this alignment also comes from CMSG opaque data area
contents of which none of us have any control.  See?  It must end up
being 64-bit aligned and with a length which is modulo 64-bits.

Alexey is right, and I don't think this suggested fix will work.

Later,
David S. Miller
davem@xxxxxxxxxx

<Prev in Thread] Current Thread [Next in Thread>