netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Evgeniy Polyakov <zbr@ioremap.net>
To: vaughan <vaughan.cao@oracle.com>
Cc: netdev@vger.kernel.org, KY Srinivasan <kys@microsoft.com>,
	"devel@linuxdriverproject.org" <devel@linuxdriverproject.org>
Subject: Re: How to assign sockaddr_nl->nl_groups when using connector
Date: Wed, 20 Mar 2013 22:29:20 +0400	[thread overview]
Message-ID: <20130320182920.GA2837@ioremap.net> (raw)
In-Reply-To: <5147CA4F.5050801@oracle.com>

Hi

On Tue, Mar 19, 2013 at 10:15:43AM +0800, vaughan (vaughan.cao@oracle.com) wrote:
> I am not quite sure how to assign nl_groups when using connector. You
> Documentation/connector/connector.txt don't explain it very clearly. I
> thought it's a bitmask representing only 32 groups.
> If I just want to subscribe only one group such as CN_KVP_IDX, what
> shall I do? Which one below is correct?
> a) l_local.nl_groups = CN_KVP_IDX;
> Or
> b) l_local.nl_groups = 1 << (CN_KVP_IDX -1)
> and bind with bind(s, (struct sockaddr *)&l_local, sizeof(struct
> sockaddr_nl)).

Iirc, first groups, created before bitmap-to-number conversion were
actually bitmaps, but then broadcast interface was obsoleted.

One should use NETLINK_ADD_MEMBERSHIP interface and specify gruop number
directly.

> I ran your example in Documentation/connector/. 'l_local.nl_groups = -1'
> in ucon.c seems subscribe all channels, because if I start cgred
> service, ucon will receive messages with idx=1.
> 
> And it seems setsockopt is not needed now, for it is done by
> netlink_autobind? You even comment it out using '#if 0' in
> Documentation/connector/ucon.c.
> 
> Could you do me a favor to check
> http://driverdev.linuxdriverproject.org/pipermail/devel/2013-March/036306.html
> to see if my understanding is correct or not? Thanks.

Yes, you are right.

-- 
	Evgeniy Polyakov

      reply	other threads:[~2013-03-20 18:29 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-19  2:15 How to assign sockaddr_nl->nl_groups when using connector vaughan
2013-03-20 18:29 ` Evgeniy Polyakov [this message]

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=20130320182920.GA2837@ioremap.net \
    --to=zbr@ioremap.net \
    --cc=devel@linuxdriverproject.org \
    --cc=kys@microsoft.com \
    --cc=netdev@vger.kernel.org \
    --cc=vaughan.cao@oracle.com \
    /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).