From: Evgeniy Polyakov <johnpol@2ka.mipt.ru>
To: Patrick McHardy <kaber@trash.net>
Cc: "David S. Miller" <davem@davemloft.net>, netdev@vger.kernel.org
Subject: Re: [1/1] netlink: fix broadcasting to the wrong group.
Date: Tue, 18 Apr 2006 00:21:50 +0400 [thread overview]
Message-ID: <20060417202150.GA10764@2ka.mipt.ru> (raw)
In-Reply-To: <4443F742.9020508@trash.net>
On Mon, Apr 17, 2006 at 10:14:58PM +0200, Patrick McHardy (kaber@trash.net) wrote:
> Evgeniy Polyakov wrote:
> > On Mon, Apr 17, 2006 at 05:35:04PM +0200, Patrick McHardy (kaber@trash.net) wrote:
> >
> >>This seems to be a misunderstanding, subscribing to groups using bind()
> >>is kept for compatibility and doesn't use group numbers but bitmasks.
> >
> >
> > So groups less than 32 are considered as bitmask, and other groups as
> > group numbers, and there is no way to have them consistent and behave
> > like group numbers?
>
> Not exactly, its not related to the group number. groups used in bind()
> are considered as bitmask and groups used for setsockopt are considered
> as group numbers. We can't change bind() because this behaviour is
> required for compatibility.
So bind and subscribing are almost exclusive and should not be used
simultaneously?
> > But this introduce some problem with subscribing - if one subscribes to
> > group 5 and is bound to the same group it allows to broadcast not only
> > to group 5, and those which have the same bits set, but also to group 16
> > (1<<(5-1)), which has nothing in common with the requested group number.
>
> Only if you use group numbers for bind(), which is plainly wrong.
Even if one uses group bitmask at bind time and later subscribes to
some group from that bitmask, this will introduce wrong behaviour with
unrelated gropus.
Maybe we should not allow to subscribe if group bitmask different from 1
was used at bind() time?
--
Evgeniy Polyakov
next prev parent reply other threads:[~2006-04-17 20:22 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-04-17 9:36 [1/1] netlink: fix broadcasting to the wrong group Evgeniy Polyakov
2006-04-17 15:35 ` Patrick McHardy
2006-04-17 19:49 ` Evgeniy Polyakov
2006-04-17 20:14 ` Patrick McHardy
2006-04-17 20:21 ` Evgeniy Polyakov [this message]
2006-04-17 23:13 ` Patrick McHardy
2006-04-18 5:18 ` Evgeniy Polyakov
2006-04-18 5:36 ` Patrick McHardy
2006-04-18 5:53 ` Evgeniy Polyakov
2006-04-18 6:00 ` Patrick McHardy
2006-04-18 6:09 ` Evgeniy Polyakov
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=20060417202150.GA10764@2ka.mipt.ru \
--to=johnpol@2ka.mipt.ru \
--cc=davem@davemloft.net \
--cc=kaber@trash.net \
--cc=netdev@vger.kernel.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).