From: jamal Date: Sun, 25 Feb 2007 17:02:23 +0000 (-0500) Subject: nl_mgrp to crap if base multicast groups exceeded X-Git-Tag: v2.6.23-071016~70 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=56b9406191a15a51320e039df1004967898f304d;p=thirdparty%2Fiproute2.git 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 Signed-off-by: Stephen Hemminger --- diff --git a/include/utils.h b/include/utils.h index 1769ca101..a3fd3356e 100644 --- a/include/utils.h +++ b/include/utils.h @@ -3,6 +3,7 @@ #include #include +#include #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; }