[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20110826.110820.2220935212459386472.davem@davemloft.net>
Date: Fri, 26 Aug 2011 11:08:20 -0400 (EDT)
From: David Miller <davem@...emloft.net>
To: ben@...adent.org.uk
Cc: netdev@...r.kernel.org
Subject: Re: [PATCH net-next v2 05/10] headers, net: Define struct
__kernel_sockaddr, replacing struct sockaddr
From: Ben Hutchings <ben@...adent.org.uk>
Date: Thu, 25 Aug 2011 05:44:15 +0100
> 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 <ben@...adent.org.uk>
...
>
> -/*
> - * 1003.1g requires sa_family_t and that sa_data is char.
> - */
> +#define sockaddr __kernel_sockaddr
This 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.
There is no reason sys/socket.h and our headers cannot co-exist and
this is the whole reason we're going through all of this pain to use
the __kernel_foo types in our networking datastructures which are
exposed to userspace.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists