From: jamal <hadi@cyberus.ca>
To: Stephen Hemminger <shemminger@linux-foundation.org>
Cc: netdev@vger.kernel.org
Subject: [IPROUTE2][GENERAL] nl_mgrp to crap if base multicast groups exceeded
Date: Sun, 25 Feb 2007 12:02:23 -0500 [thread overview]
Message-ID: <1172422943.3942.32.camel@localhost> (raw)
[-- Attachment #1: Type: text/plain, Size: 16 bytes --]
cheers,
jamal
[-- Attachment #2: diebadmgrp --]
[-- Type: text/plain, Size: 1152 bytes --]
[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>
---
commit f3d272cea2870805677809bf121737fb6c36dc8e
tree b1e42d5c8d9122a600f2f81e04b0d197642b1878
parent 539bc1cc1b002700504ad8cbe82ea451026c5fe4
author Jamal Hadi Salim <hadi@cyberus.ca> Sun, 25 Feb 2007 11:50:53 -0500
committer Jamal Hadi Salim <hadi@cyberus.ca> Sun, 25 Feb 2007 11:50:53 -0500
include/utils.h | 7 ++++++-
1 files changed, 6 insertions(+), 1 deletions(-)
diff --git a/include/utils.h b/include/utils.h
index 1769ca1..a3fd335 100644
--- a/include/utils.h
+++ b/include/utils.h
@@ -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;
}
next reply other threads:[~2007-02-25 17:02 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-02-25 17:02 jamal [this message]
2007-03-13 21:42 ` [IPROUTE2][GENERAL] nl_mgrp to crap if base multicast groups exceeded Stephen Hemminger
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1172422943.3942.32.camel@localhost \
--to=hadi@cyberus.ca \
--cc=netdev@vger.kernel.org \
--cc=shemminger@linux-foundation.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).