Lines Matching defs:groups
414 WARN_ON(nlk_sk(sk)->groups);
558 for (i = 0; i < NLGRPLONGS(tbl->groups); i++) {
562 mask |= nlk_sk(sk)->groups[i];
678 void (*release)(struct sock *sock, unsigned long *groups);
736 kfree(nlk->groups);
737 nlk->groups = NULL;
768 nlk->netlink_release(sk, nlk->groups);
777 if (test_bit(i, nlk->groups))
960 unsigned int groups;
966 groups = nl_table[sk->sk_protocol].groups;
972 if (nlk->ngroups >= groups)
975 new_groups = krealloc(nlk->groups, NLGRPSZ(groups), GFP_ATOMIC);
981 NLGRPSZ(groups) - NLGRPSZ(nlk->ngroups));
983 nlk->groups = new_groups;
984 nlk->ngroups = groups;
990 static void netlink_undo_bind(int group, long unsigned int groups,
1000 if (test_bit(undo, &groups))
1012 unsigned long groups;
1020 groups = nladdr->nl_groups;
1023 if (groups) {
1032 groups &= (1UL << nlk->ngroups) - 1;
1044 if (nlk->netlink_bind && groups) {
1047 /* nl_groups is a u32, so cap the maximum groups we can bind */
1049 if (!test_bit(group, &groups))
1054 netlink_undo_bind(group, groups, sk);
1068 netlink_undo_bind(BITS_PER_TYPE(u32), groups, sk);
1073 if (!groups && (nlk->groups == NULL || !(u32)nlk->groups[0]))
1079 hweight32(groups) -
1080 hweight32(nlk->groups[0]));
1081 nlk->groups[0] = (nlk->groups[0] & ~0xffffffffUL) | groups;
1157 nladdr->nl_groups = nlk->groups ? nlk->groups[0] : 0;
1397 if (listeners && group - 1 < nl_table[sk->sk_protocol].groups)
1450 !test_bit(p->group - 1, nlk->groups))
1600 !test_bit(p->group - 1, nlk->groups))
1654 old = test_bit(group - 1, nlk->groups);
1656 __assign_bit(group - 1, nlk->groups, new);
1773 if (put_user((u32)(nlk->groups[idx] >> shift),
2025 unsigned int groups;
2040 if (!cfg || cfg->groups < 32)
2041 groups = 32;
2043 groups = cfg->groups;
2045 listeners = kzalloc(sizeof(*listeners) + NLGRPSZ(groups), GFP_KERNEL);
2061 nl_table[unit].groups = groups;
2100 int __netlink_change_ngroups(struct sock *sk, unsigned int groups)
2105 if (groups < 32)
2106 groups = 32;
2108 if (NLGRPSZ(tbl->groups) < NLGRPSZ(groups)) {
2109 new = kzalloc(sizeof(*new) + NLGRPSZ(groups), GFP_ATOMIC);
2113 memcpy(new->masks, old->masks, NLGRPSZ(tbl->groups));
2118 tbl->groups = groups;
2124 * netlink_change_ngroups - change number of multicast groups
2126 * This changes the number of multicast groups that are available
2128 * change the number of groups to below 32. Also note that it does
2130 * number of groups is reduced.
2133 * @groups: The new number of groups.
2135 int netlink_change_ngroups(struct sock *sk, unsigned int groups)
2140 err = __netlink_change_ngroups(sk, groups);
2702 nlk->groups ? (u32)nlk->groups[0] : 0,
2843 int groups = 32;
2845 listeners = kzalloc(sizeof(*listeners) + NLGRPSZ(groups), GFP_KERNEL);
2851 nl_table[NETLINK_USERSOCK].groups = groups;