nl_mgrp to crap if base multicast groups exceeded
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>
This commit is contained in:
parent
b64f58b013
commit
56b9406191
|
|
@ -3,6 +3,7 @@
|
|||
|
||||
#include <asm/types.h>
|
||||
#include <resolv.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "libnetlink.h"
|
||||
#include "ll_map.h"
|
||||
|
|
@ -129,7 +130,11 @@ static __inline__ int get_user_hz(void)
|
|||
|
||||
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;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue