diff options
author | Richard Guy Briggs <rgb@redhat.com> | 2014-04-22 21:31:55 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2014-04-22 21:42:26 -0400 |
commit | 7774d5e03f4a41ec7c1e736acc108f112003bb4a (patch) | |
tree | d8f3f9db89b1660d79491885d0f757c95a582414 /net/netlink | |
parent | 4f520900522fd596e336c07e9aafd5b7a9564235 (diff) |
netlink: implement unbind to netlink_setsockopt NETLINK_DROP_MEMBERSHIP
Call the per-protocol unbind function rather than bind function on
NETLINK_DROP_MEMBERSHIP in netlink_setsockopt().
Signed-off-by: Richard Guy Briggs <rgb@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/netlink')
-rw-r--r-- | net/netlink/af_netlink.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/net/netlink/af_netlink.c b/net/netlink/af_netlink.c index 7e8d229bc010..92f4b6915e89 100644 --- a/net/netlink/af_netlink.c +++ b/net/netlink/af_netlink.c | |||
@@ -2129,7 +2129,7 @@ static int netlink_setsockopt(struct socket *sock, int level, int optname, | |||
2129 | return err; | 2129 | return err; |
2130 | if (!val || val - 1 >= nlk->ngroups) | 2130 | if (!val || val - 1 >= nlk->ngroups) |
2131 | return -EINVAL; | 2131 | return -EINVAL; |
2132 | if (nlk->netlink_bind) { | 2132 | if (optname == NETLINK_ADD_MEMBERSHIP && nlk->netlink_bind) { |
2133 | err = nlk->netlink_bind(val); | 2133 | err = nlk->netlink_bind(val); |
2134 | if (err) | 2134 | if (err) |
2135 | return err; | 2135 | return err; |
@@ -2138,6 +2138,8 @@ static int netlink_setsockopt(struct socket *sock, int level, int optname, | |||
2138 | netlink_update_socket_mc(nlk, val, | 2138 | netlink_update_socket_mc(nlk, val, |
2139 | optname == NETLINK_ADD_MEMBERSHIP); | 2139 | optname == NETLINK_ADD_MEMBERSHIP); |
2140 | netlink_table_ungrab(); | 2140 | netlink_table_ungrab(); |
2141 | if (optname == NETLINK_DROP_MEMBERSHIP && nlk->netlink_unbind) | ||
2142 | nlk->netlink_unbind(val); | ||
2141 | 2143 | ||
2142 | err = 0; | 2144 | err = 0; |
2143 | break; | 2145 | break; |