Re: [PATCH net-next v2 05/10] headers, net: Define struct __kernel_sockaddr, replacing struct sockaddr
flat view
From: Ben Hutchings <hidden>
Date: 2011-08-26 15:42:51
On Fri, Aug 26, 2011 at 11:08:20AM -0400, David Miller wrote:
From: Ben Hutchings <redacted> Date: Thu, 25 Aug 2011 05:44:15 +0100quoted
Commit 9c501935a3cdcf6b1d35aaee3aa11c7a7051a305 ('net: Support inclusion of <linux/socket.h> before <sys/socket.h>') removed the definition of struct sockaddr for userland. But we still have several headers using struct sockaddr, and we shouldn't make them include <sys/socket.h> as that risks recursive inclusion in future. Define and use an identical struct __kernel_sockaddr instead. Signed-off-by: Ben Hutchings <redacted>...quoted
-/* - * 1003.1g requires sa_family_t and that sa_data is char. - */ +#define sockaddr __kernel_sockaddrThis cure is worse than the disease. Now any application that includes sys/socket.h one way or another is now going to get a real hard build failure since __kernel_sockaddr will effectively get redefined.
[...]
This #define is in the #ifdef __KERNEL__ section. I don't want t
change all the in-kernel users to say __kernel_sockaddr. This is
just the same as the preceding 'typedef __kernel_sa_family_t
sa_family_t' except that you can't create struct aliases that way.
Ben.
--
Ben Hutchings
We get into the habit of living before acquiring the habit of thinking.
- Albert Camus