Import from old repository commit 61ef2b42a9c4ba8e1600f15bb0236765edc2ad45.
[cascardo/ovs.git] / datapath / linux-2.6 / compat-2.6 / genetlink-openvswitch.c
1 #include "net/genetlink.h"
2
3 #include <linux/version.h>
4 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,23)
5
6 /* We use multicast groups 16 through 31 to avoid colliding with the multicast
7  * group selected by brcompat_mod, which uses groups 32.  Collision isn't
8  * fatal--multicast listeners should check that the family is the one that they
9  * want and discard others--but it wastes time and memory to receive unwanted
10  * messages. */
11 int genl_register_mc_group(struct genl_family *family,
12                            struct genl_multicast_group *grp)
13 {
14         /* This code is called single-threaded. */
15         static unsigned int next_id = 0;
16         grp->id = next_id++ % 16 + 16;
17         grp->family = family;
18
19         return 0;
20 }
21
22 #endif /* kernel < 2.6.23 */