Older kernels do not advertise the multicast groups of families
when requested by userspace.  As a workaround, this patch hardcodes
the multicast group ID of the ovs_vport family on these kernels.
Userspace will be able to fall back to this hardcoded value if the
standard mechanism is unavailable.

Signed-off-by: Ethan Jackson <et...@nicira.com>
---
 datapath/linux/compat/genetlink.inc     |   10 +++++++++-
 include/openvswitch/datapath-protocol.h |    1 +
 2 files changed, 10 insertions(+), 1 deletions(-)

diff --git a/datapath/linux/compat/genetlink.inc 
b/datapath/linux/compat/genetlink.inc
index d381e4f..d89d3a4 100644
--- a/datapath/linux/compat/genetlink.inc
+++ b/datapath/linux/compat/genetlink.inc
@@ -6,6 +6,8 @@
 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,23)
 #include <linux/mutex.h>
 
+#include "openvswitch/datapath-protocol.h"
+
 static DEFINE_MUTEX(mc_group_mutex);
 
 int genl_register_mc_group(struct genl_family *family,
@@ -13,9 +15,15 @@ int genl_register_mc_group(struct genl_family *family,
 {
        static int next_group = GENL_FIRST_MCGROUP;
 
+       grp->family = family;
+
+       if (!strcmp(grp->name, OVS_VPORT_MCGROUP)) {
+               grp->id = OVS_VPORT_MCGROUP_FALLBACK_ID;
+               return 0;
+       }
+
        mutex_lock(&mc_group_mutex);
        grp->id = next_group;
-       grp->family = family;
 
        if (++next_group > GENL_LAST_MCGROUP)
                next_group = GENL_FIRST_MCGROUP;
diff --git a/include/openvswitch/datapath-protocol.h 
b/include/openvswitch/datapath-protocol.h
index 5687792..e2fa578 100644
--- a/include/openvswitch/datapath-protocol.h
+++ b/include/openvswitch/datapath-protocol.h
@@ -202,6 +202,7 @@ enum ovs_vport_type {
 
 #define OVS_VPORT_FAMILY  "ovs_vport"
 #define OVS_VPORT_MCGROUP "ovs_vport"
+#define OVS_VPORT_MCGROUP_FALLBACK_ID 214
 
 enum ovs_vport_cmd {
        OVS_VPORT_CMD_UNSPEC,
-- 
1.7.6.1

_______________________________________________
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev

Reply via email to