@@ -485,19 +485,20 @@ int mptcp_pm_nl_get_addr_doit(struct sk_buff *skb, struct genl_info *info)
return ret;
}
-static int mptcp_pm_dump_addr(struct sk_buff *msg, struct netlink_callback *cb)
+static int mptcp_pm_dump_addr(struct sk_buff *msg, struct netlink_callback *cb,
+ const struct genl_info *info)
{
- const struct genl_info *info = genl_info_dump(cb);
-
if (info->attrs[MPTCP_PM_ATTR_TOKEN])
- return mptcp_userspace_pm_dump_addr(msg, cb);
- return mptcp_pm_nl_dump_addr(msg, cb);
+ return mptcp_userspace_pm_dump_addr(msg, cb, info);
+ return mptcp_pm_nl_dump_addr(msg, cb, info);
}
int mptcp_pm_nl_get_addr_dumpit(struct sk_buff *msg,
struct netlink_callback *cb)
{
- return mptcp_pm_dump_addr(msg, cb);
+ const struct genl_info *info = genl_info_dump(cb);
+
+ return mptcp_pm_dump_addr(msg, cb, info);
}
static int mptcp_pm_set_flags(struct sk_buff *skb, struct genl_info *info)
@@ -1784,9 +1784,10 @@ int mptcp_pm_nl_get_addr(u8 id, struct mptcp_pm_addr_entry *addr,
}
int mptcp_pm_nl_dump_addr(struct sk_buff *msg,
- struct netlink_callback *cb)
+ struct netlink_callback *cb,
+ const struct genl_info *info)
{
- struct net *net = sock_net(msg->sk);
+ struct net *net = genl_info_net(info);
struct mptcp_pm_addr_entry *entry;
struct pm_nl_pernet *pernet;
int id = cb->args[0];
@@ -615,12 +615,12 @@ int mptcp_userspace_pm_set_flags(struct sk_buff *skb, struct genl_info *info)
}
int mptcp_userspace_pm_dump_addr(struct sk_buff *msg,
- struct netlink_callback *cb)
+ struct netlink_callback *cb,
+ const struct genl_info *info)
{
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_entry *entry;
struct mptcp_sock *msk;
int ret = -EINVAL;
@@ -1128,9 +1128,11 @@ bool mptcp_pm_is_backup(struct mptcp_sock *msk, struct sock_common *skc);
bool mptcp_pm_nl_is_backup(struct mptcp_sock *msk, struct mptcp_addr_info *skc);
bool mptcp_userspace_pm_is_backup(struct mptcp_sock *msk, struct mptcp_addr_info *skc);
int mptcp_pm_nl_dump_addr(struct sk_buff *msg,
- struct netlink_callback *cb);
+ struct netlink_callback *cb,
+ const struct genl_info *info);
int mptcp_userspace_pm_dump_addr(struct sk_buff *msg,
- struct netlink_callback *cb);
+ struct netlink_callback *cb,
+ const struct genl_info *info);
int mptcp_pm_nl_get_addr(u8 id, struct mptcp_pm_addr_entry *addr,
const struct genl_info *info);
int mptcp_userspace_pm_get_addr(u8 id, struct mptcp_pm_addr_entry *addr,