From 0a397a2fcafd3915433d4d476d41da53b07282d2 Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Tue, 6 Sep 2011 09:33:26 -0700 Subject: [PATCH] netlink-protocol: Move CTRL_ATTR_MCAST definitions for consistency. One of the current goals of netlink-protocol.h, for better or for worse, is to ensure that the same definitions are available whether a Linux kernel is in use or not. One of the ways it accomplishes this is by putting the conditional definitions that test for features missing in old kernels at the very end, after the dummy definitions used on non-Linux platforms. However, commit b0025c8389f "netlink-protocol: Define missing symbols" added new conditional definitions only in the Linux platform case, which means that those definitions won't be available on non-Linux platforms. This commit moves them to the end, instead. The symbols that are moved are only used from netlink-socket.c, which is only built on Linux platforms, so this does not change an actual bug. It only makes the location of the definitions consistent with prior practice. --- lib/netlink-protocol.h | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/lib/netlink-protocol.h b/lib/netlink-protocol.h index 64f773e5..521c5bff 100644 --- a/lib/netlink-protocol.h +++ b/lib/netlink-protocol.h @@ -37,24 +37,6 @@ #include #include -/* Some Xenddks have an outdated genetlink header file which doesn't have some - * symbols it should. */ -#ifndef CTRL_ATTR_MCAST_GRP_MAX - -#undef CTRL_ATTR_MAX -#define CTRL_ATTR_MAX 7 -#define CTRL_ATTR_MCAST_GROUPS 7 - -enum { - CTRL_ATTR_MCAST_GRP_UNSPEC, - CTRL_ATTR_MCAST_GRP_NAME, - CTRL_ATTR_MCAST_GRP_ID, - __CTRL_ATTR_MCAST_GRP_MAX, -}; - -#define CTRL_ATTR_MCAST_GRP_MAX (__CTRL_ATTR_MCAST_GRP_MAX - 1) -#endif /* CTRL_ATTR_MCAST_GRP_MAX */ - #else #define NETLINK_GENERIC 16 @@ -179,4 +161,22 @@ enum { #define NETLINK_DROP_MEMBERSHIP 2 #endif +/* These were introduced all together in 2.6.23. (We want our programs to + * support the newer kernel features even if compiled with older headers.) */ +#ifndef CTRL_ATTR_MCAST_GRP_MAX + +#undef CTRL_ATTR_MAX +#define CTRL_ATTR_MAX 7 +#define CTRL_ATTR_MCAST_GROUPS 7 + +enum { + CTRL_ATTR_MCAST_GRP_UNSPEC, + CTRL_ATTR_MCAST_GRP_NAME, + CTRL_ATTR_MCAST_GRP_ID, + __CTRL_ATTR_MCAST_GRP_MAX, +}; + +#define CTRL_ATTR_MCAST_GRP_MAX (__CTRL_ATTR_MCAST_GRP_MAX - 1) +#endif /* CTRL_ATTR_MCAST_GRP_MAX */ + #endif /* netlink-protocol.h */ -- 2.30.2