[ovs-dev] [tunid64 v3 1/8] netlink: Make netlink-protocol.h compatible with <linux/netlink.h>.
Jesse Gross
jesse at nicira.com
Fri Dec 10 18:59:07 UTC 2010
On Fri, Dec 10, 2010 at 10:31 AM, Ben Pfaff <blp at nicira.com> wrote:
> On Thu, Dec 09, 2010 at 03:45:54PM -0800, Jesse Gross wrote:
>> On Thu, Dec 9, 2010 at 2:48 PM, Ben Pfaff <blp at nicira.com> wrote:
>> > Until now, netlink-protocol.h and <linux/netlink.h> could not both be
>> > included by a single source file, because they contained conflicting
>> > definitions. This commit fixes the problem, by having netlink-protocol.h
>> > delegate to <linux/netlink.h> where it is available.
>> >
>> > Here's an example of the problem: odp-util.c includes both
>> > datapath-protocol.h and will need netlink-protocol.h also so that it can
>> > look through actions defined as struct nlattr. datapath-protocol.h
>> > includes <linux/if_link.h> for the definition of rtnl_link_stats64, and
>> > <linux/if_link.h> includes <linux/netlink.h>.
>>
>> I'm OK with the changes in this file now. However, I believe we still
>> need to change automake.mk so that the Netlink helper files get
>> compiled when !HAVE_NETLINK on non-Linux platforms.
>
> Hmm, I forgot about that. It's worse than that, though, because only
> some of netlink.c can be compiled outside of Linux. At the very least
> AF_NETLINK will be undefined elsewhere. We could make it compile, but
> in my opinion it's better to split out the Linux-specific bits. So I
> wedged in the following commit, which is almost all just moving code
> around.
>
> (I'm sure that there are other reasons OVS doesn't compile outside of
> Linux right now, since we haven't tried it in a while. But at least we
> aren't making it worse.)
>
> --8<--------------------------cut here-------------------------->8--
>
> From: Ben Pfaff <blp at nicira.com>
> Date: Fri, 10 Dec 2010 09:51:03 -0800
> Subject: [PATCH] netlink: Split into generic and Linux-specific parts.
>
> The parts of the netlink module that are related to sockets are
> Linux-specific, since only Linux has AF_NETLINK sockets. The rest can be
> built anywhere. This commit breaks them into two modules, and builds the
> generic one on all platforms.
I agree this, this is the right way to do it.
Acked-by: Jesse Gross <jesse at nicira.com>
More information about the dev
mailing list