cheers,
jamal
[GENERAL] nl_mgrp to crap if base multicast groups exceeded
The old scheme of bitmasks works only for the first 32 groups.
Above that the setsockopt scheme must be used.
Signed-off-by: J Hadi Salim <hadi@cyberus.ca>
Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org>
#include <asm/types.h>
#include <resolv.h>
+#include <stdlib.h>
#include "libnetlink.h"
#include "ll_map.h"
static inline __u32 nl_mgrp(__u32 group)
{
- return group ? (1 << (group -1)) : 0;
+ if (group > 31 ) {
+ fprintf(stderr, "Use setsockopt for this group %d\n", group);
+ exit(-1);
+ }
+ return group ? (1 << (group - 1)) : 0;
}