From: vaughan <vaughan.cao@oracle.com>
To: zbr@ioremap.net
Cc: netdev@vger.kernel.org, KY Srinivasan <kys@microsoft.com>,
"devel@linuxdriverproject.org" <devel@linuxdriverproject.org>
Subject: How to assign sockaddr_nl->nl_groups when using connector
Date: Tue, 19 Mar 2013 10:15:43 +0800 [thread overview]
Message-ID: <5147CA4F.5050801@oracle.com> (raw)
Hi Evgeniy,
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)).
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.
--
Regards,
Vaughan
next reply other threads:[~2013-03-19 2:14 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-03-19 2:15 vaughan [this message]
2013-03-20 18:29 ` How to assign sockaddr_nl->nl_groups when using connector 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=5147CA4F.5050801@oracle.com \
--to=vaughan.cao@oracle.com \
--cc=devel@linuxdriverproject.org \
--cc=kys@microsoft.com \
--cc=netdev@vger.kernel.org \
--cc=zbr@ioremap.net \
/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).