Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F102571510
D47548.id.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D47548.id.diff
View Options
diff --git a/sys/netlink/netlink_domain.c b/sys/netlink/netlink_domain.c
--- a/sys/netlink/netlink_domain.c
+++ b/sys/netlink/netlink_domain.c
@@ -145,7 +145,7 @@
if (!nlp_unconstrained_vnet(nlp))
return;
- nlp->nl_groups[group_id / 64] |= (uint64_t)1 << (group_id % 64);
+ BIT_SET(NLP_MAX_GROUPS, group_id, &nlp->nl_groups);
}
static void
@@ -154,7 +154,7 @@
MPASS(group_id <= NLP_MAX_GROUPS);
--group_id;
- nlp->nl_groups[group_id / 64] &= ~((uint64_t)1 << (group_id % 64));
+ BIT_CLR(NLP_MAX_GROUPS, group_id, &nlp->nl_groups);
}
static bool
@@ -163,7 +163,7 @@
MPASS(group_id <= NLP_MAX_GROUPS);
--group_id;
- return (nlp->nl_groups[group_id / 64] & ((uint64_t)1 << (group_id % 64)));
+ return (BIT_ISSET(NLP_MAX_GROUPS, group_id, &nlp->nl_groups));
}
static uint32_t
diff --git a/sys/netlink/netlink_var.h b/sys/netlink/netlink_var.h
--- a/sys/netlink/netlink_var.h
+++ b/sys/netlink/netlink_var.h
@@ -53,9 +53,10 @@
#define NLP_MAX_GROUPS 128
+BITSET_DEFINE(nl_groups, NLP_MAX_GROUPS);
struct nlpcb {
struct socket *nl_socket;
- uint64_t nl_groups[NLP_MAX_GROUPS / 64];
+ struct nl_groups nl_groups;
uint32_t nl_port;
uint32_t nl_flags;
uint32_t nl_process_id;
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Nov 15, 5:17 AM (7 h, 11 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
14638740
Default Alt Text
D47548.id.diff (1 KB)
Attached To
Mode
D47548: netlink: use bitset(9)
Attached
Detach File
Event Timeline
Log In to Comment