datapath: Enforce mutual exclusion between bridge and brcompat_mod.
[sliver-openvswitch.git] / datapath / brcompat.c
index 10a75ec..339b5dc 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2007-2011 Nicira Networks.
+ * Copyright (c) 2007-2012 Nicira Networks.
  *
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of version 2 of the GNU General Public
@@ -560,3 +560,12 @@ module_exit(brc_cleanup);
 MODULE_DESCRIPTION("Open vSwitch bridge compatibility");
 MODULE_AUTHOR("Nicira Networks");
 MODULE_LICENSE("GPL");
+
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36)
+/*
+ * In kernels 2.6.36 and later, Open vSwitch can safely coexist with
+ * the Linux bridge module, but it does not make sense to load both bridge and
+ * brcompat_mod, so this prevents it.
+ */
+BRIDGE_MUTUAL_EXCLUSION;
+#endif