Re: [PATCH][v6] netlink: have netlink per-protocol bind function return an error code.

2014-03-26 Thread Patrick McHardy
On Tue, Mar 25, 2014 at 08:50:56AM -0400, Richard Guy Briggs wrote: > + if (nlk->netlink_bind && nladdr->nl_groups) { > + int i; > + > + for (i = 0; i < nlk->ngroups; i++) > + if (test_bit(i, (long unsigned int > *)&nladdr->nl_groups)) { > +

Re: [PATCH][v6] netlink: have netlink per-protocol bind function return an error code.

2014-03-26 Thread David Miller
From: Richard Guy Briggs Date: Tue, 25 Mar 2014 08:50:56 -0400 > @@ -1441,6 +1445,24 @@ static int netlink_bind(struct socket *sock, struct > sockaddr *addr, > if (!nladdr->nl_groups && (nlk->groups == NULL || !(u32)nlk->groups[0])) > return 0; > > + if (nlk->netlink_bi

[PATCH][v6] netlink: have netlink per-protocol bind function return an error code.

2014-03-25 Thread Richard Guy Briggs
Have the netlink per-protocol optional bind function return an int error code rather than void to signal a failure. This will enable netlink protocols to perform extra checks including capabilities and permissions verifications when updating memberships in multicast groups. In netlink_bind() and