diff options
Diffstat (limited to 'net/netlink/af_netlink.c')
-rw-r--r-- | net/netlink/af_netlink.c | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/net/netlink/af_netlink.c b/net/netlink/af_netlink.c index 55180b99562a..a4bafbf15097 100644 --- a/net/netlink/af_netlink.c +++ b/net/netlink/af_netlink.c | |||
@@ -1609,6 +1609,16 @@ int netlink_change_ngroups(struct sock *sk, unsigned int groups) | |||
1609 | return err; | 1609 | return err; |
1610 | } | 1610 | } |
1611 | 1611 | ||
1612 | void __netlink_clear_multicast_users(struct sock *ksk, unsigned int group) | ||
1613 | { | ||
1614 | struct sock *sk; | ||
1615 | struct hlist_node *node; | ||
1616 | struct netlink_table *tbl = &nl_table[ksk->sk_protocol]; | ||
1617 | |||
1618 | sk_for_each_bound(sk, node, &tbl->mc_list) | ||
1619 | netlink_update_socket_mc(nlk_sk(sk), group, 0); | ||
1620 | } | ||
1621 | |||
1612 | /** | 1622 | /** |
1613 | * netlink_clear_multicast_users - kick off multicast listeners | 1623 | * netlink_clear_multicast_users - kick off multicast listeners |
1614 | * | 1624 | * |
@@ -1619,15 +1629,8 @@ int netlink_change_ngroups(struct sock *sk, unsigned int groups) | |||
1619 | */ | 1629 | */ |
1620 | void netlink_clear_multicast_users(struct sock *ksk, unsigned int group) | 1630 | void netlink_clear_multicast_users(struct sock *ksk, unsigned int group) |
1621 | { | 1631 | { |
1622 | struct sock *sk; | ||
1623 | struct hlist_node *node; | ||
1624 | struct netlink_table *tbl = &nl_table[ksk->sk_protocol]; | ||
1625 | |||
1626 | netlink_table_grab(); | 1632 | netlink_table_grab(); |
1627 | 1633 | __netlink_clear_multicast_users(ksk, group); | |
1628 | sk_for_each_bound(sk, node, &tbl->mc_list) | ||
1629 | netlink_update_socket_mc(nlk_sk(sk), group, 0); | ||
1630 | |||
1631 | netlink_table_ungrab(); | 1634 | netlink_table_ungrab(); |
1632 | } | 1635 | } |
1633 | 1636 | ||