Re: [PATCH] net: define __packed for the userspace code

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: David Miller
Date: Sunday, August 22, 2010 - 6:36 pm

From: Changli Gao <xiaosuo@gmail.com>
Date: Sun, 22 Aug 2010 21:47:06 +0800


I don't think this it the reason it was being used here.

Any, for one thing, we definitely cannot remove the existing packed
markers or else we will break every single userland tool out there
using these socket address structures.

Even the first two members (sa_family_t and unsigned int) will be
positioned differently if we remove the marker.

I suspect the packed attribute is there to make sure the pppo* socket
address structures fit within the generic socket address object size.
(see struct __kernel_sockaddr_storage and struct sockaddr).

As to the problem at-hand, I think we need to use __attribute__((packed))
here.  And that's what I'll commit into net-2.6 and net-next-2.6
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH] net: define __packed for the userspace code, Changli Gao, (Sun Aug 22, 4:12 am)
Re: [PATCH] net: define __packed for the userspace code, Arnd Bergmann, (Sun Aug 22, 6:07 am)
Re: [PATCH] net: define __packed for the userspace code, David Miller, (Sun Aug 22, 6:36 pm)
Re: [PATCH] net: define __packed for the userspace code, David Miller, (Sun Aug 22, 7:36 pm)
Re: [PATCH] net: define __packed for the userspace code, David Miller, (Sun Aug 22, 9:16 pm)