All of lore.kernel.org
 help / color / mirror / Atom feed
* How to assign sockaddr_nl->nl_groups when using connector
@ 2013-03-19  2:15 vaughan
  2013-03-20 18:29 ` Evgeniy Polyakov
  0 siblings, 1 reply; 2+ messages in thread
From: vaughan @ 2013-03-19  2:15 UTC (permalink / raw)
  To: zbr; +Cc: netdev, KY Srinivasan, devel

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: How to assign sockaddr_nl->nl_groups when using connector
  2013-03-19  2:15 How to assign sockaddr_nl->nl_groups when using connector vaughan
@ 2013-03-20 18:29 ` Evgeniy Polyakov
  0 siblings, 0 replies; 2+ messages in thread
From: Evgeniy Polyakov @ 2013-03-20 18:29 UTC (permalink / raw)
  To: vaughan; +Cc: netdev, KY Srinivasan, devel

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-03-20 18:29 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-03-19  2:15 How to assign sockaddr_nl->nl_groups when using connector vaughan
2013-03-20 18:29 ` Evgeniy Polyakov

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.