aboutsummaryrefslogtreecommitdiff
path: root/lib/netlink-protocol.h
diff options
context:
space:
mode:
authorBen Pfaff <blp@nicira.com>2011-09-06 09:33:26 -0700
committerBen Pfaff <blp@nicira.com>2011-09-06 09:33:26 -0700
commit0a397a2fcafd3915433d4d476d41da53b07282d2 (patch)
treeb8a1422705f78fd813126cd2cd038d659505f9d2 /lib/netlink-protocol.h
parentb0025c8389f6b8d0087df3468c14072a9935eb61 (diff)
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.
Diffstat (limited to 'lib/netlink-protocol.h')
-rw-r--r--lib/netlink-protocol.h36
1 files 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 <linux/netlink.h>
#include <linux/genetlink.h>
-/* 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 */