@@ -47,7 +47,7 @@ static int mptcp_userspace_pm_append_new_local_addr(struct mptcp_sock *msk,
struct mptcp_pm_addr_entry *entry,
bool needs_id)
{
- DECLARE_BITMAP(id_bitmap, MPTCP_PM_MAX_ADDR_ID + 1);
+ struct mptcp_pm_addr_id_bitmap id_bitmap;
struct mptcp_pm_addr_entry *match = NULL;
struct sock *sk = (struct sock *)msk;
struct mptcp_pm_addr_entry *e;
@@ -55,7 +55,7 @@ static int mptcp_userspace_pm_append_new_local_addr(struct mptcp_sock *msk,
bool id_match = false;
int ret = -EINVAL;
- bitmap_zero(id_bitmap, MPTCP_PM_MAX_ADDR_ID + 1);
+ bitmap_zero(id_bitmap.map, MPTCP_PM_MAX_ADDR_ID + 1);
spin_lock_bh(&msk->pm.lock);
mptcp_for_each_userspace_pm_addr(msk, e) {
@@ -69,7 +69,7 @@ static int mptcp_userspace_pm_append_new_local_addr(struct mptcp_sock *msk,
} else if (addr_match || id_match) {
break;
}
- __set_bit(e->addr.id, id_bitmap);
+ __set_bit(e->addr.id, id_bitmap.map);
}
if (!match && !addr_match && !id_match) {
@@ -84,7 +84,7 @@ static int mptcp_userspace_pm_append_new_local_addr(struct mptcp_sock *msk,
*e = *entry;
if (!e->addr.id && needs_id)
- e->addr.id = find_next_zero_bit(id_bitmap,
+ e->addr.id = find_next_zero_bit(id_bitmap.map,
MPTCP_PM_MAX_ADDR_ID + 1,
1);
list_add_tail_rcu(&e->list, &msk->pm.userspace_pm_local_addr_list);
@@ -633,16 +633,14 @@ int mptcp_userspace_pm_set_flags(struct mptcp_pm_addr_entry *local,
int mptcp_userspace_pm_dump_addr(struct sk_buff *msg,
struct netlink_callback *cb)
{
- struct id_bitmap {
- DECLARE_BITMAP(map, MPTCP_PM_MAX_ADDR_ID + 1);
- } *bitmap;
const struct genl_info *info = genl_info_dump(cb);
+ struct mptcp_pm_addr_id_bitmap *bitmap;
struct mptcp_pm_addr_entry *entry;
struct mptcp_sock *msk;
int ret = -EINVAL;
struct sock *sk;
- bitmap = (struct id_bitmap *)cb->ctx;
+ bitmap = (struct mptcp_pm_addr_id_bitmap *)cb->ctx;
msk = mptcp_userspace_pm_get_sock(info);
if (!msk)
@@ -212,6 +212,10 @@ enum mptcp_addr_signal_status {
/* max value of mptcp_addr_info.id */
#define MPTCP_PM_MAX_ADDR_ID U8_MAX
+struct mptcp_pm_addr_id_bitmap {
+ DECLARE_BITMAP(map, MPTCP_PM_MAX_ADDR_ID + 1);
+};
+
struct mptcp_pm_data {
struct mptcp_addr_info local;
struct mptcp_addr_info remote;