Skip to content

Commit c49aeb4

Browse files
Geliang Tangintel-lab-lkp
authored andcommitted
mptcp: change info of get_addr as const
get_addr() interfaces will be invoked by dump_addr(), which using const parameters "info", so this patch changes "info" parameters of get_addr() as const too. Some adaptations are also needed. No longer use genl_info_pm_nl() because it doesn't accept a 'const' variable, but that's OK to get pernet via genl_info_net(). Signed-off-by: Geliang Tang <[email protected]>
1 parent 5a5db1a commit c49aeb4

File tree

4 files changed

+9
-6
lines changed

4 files changed

+9
-6
lines changed

net/mptcp/pm.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -435,7 +435,7 @@ bool mptcp_pm_is_backup(struct mptcp_sock *msk, struct sock_common *skc)
435435
}
436436

437437
static int mptcp_pm_get_addr(u8 id, struct mptcp_pm_addr_entry *addr,
438-
struct genl_info *info)
438+
const struct genl_info *info)
439439
{
440440
if (info->attrs[MPTCP_PM_ATTR_TOKEN])
441441
return mptcp_userspace_pm_get_addr(id, addr, info);

net/mptcp/pm_netlink.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1763,12 +1763,15 @@ int mptcp_nl_fill_addr(struct sk_buff *skb,
17631763
}
17641764

17651765
int mptcp_pm_nl_get_addr(u8 id, struct mptcp_pm_addr_entry *addr,
1766-
struct genl_info *info)
1766+
const struct genl_info *info)
17671767
{
1768-
struct pm_nl_pernet *pernet = genl_info_pm_nl(info);
1768+
struct net *net = genl_info_net(info);
17691769
struct mptcp_pm_addr_entry *entry;
1770+
struct pm_nl_pernet *pernet;
17701771
int ret = -EINVAL;
17711772

1773+
pernet = pm_nl_get_pernet(net);
1774+
17721775
rcu_read_lock();
17731776
entry = __lookup_addr_by_id(pernet, id);
17741777
if (entry) {

net/mptcp/pm_userspace.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -664,7 +664,7 @@ int mptcp_userspace_pm_dump_addr(struct sk_buff *msg,
664664
}
665665

666666
int mptcp_userspace_pm_get_addr(u8 id, struct mptcp_pm_addr_entry *addr,
667-
struct genl_info *info)
667+
const struct genl_info *info)
668668
{
669669
struct mptcp_pm_addr_entry *entry;
670670
struct mptcp_sock *msk;

net/mptcp/protocol.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1132,9 +1132,9 @@ int mptcp_pm_nl_dump_addr(struct sk_buff *msg,
11321132
int mptcp_userspace_pm_dump_addr(struct sk_buff *msg,
11331133
struct netlink_callback *cb);
11341134
int mptcp_pm_nl_get_addr(u8 id, struct mptcp_pm_addr_entry *addr,
1135-
struct genl_info *info);
1135+
const struct genl_info *info);
11361136
int mptcp_userspace_pm_get_addr(u8 id, struct mptcp_pm_addr_entry *addr,
1137-
struct genl_info *info);
1137+
const struct genl_info *info);
11381138

11391139
static inline u8 subflow_get_local_id(const struct mptcp_subflow_context *subflow)
11401140
{

0 commit comments

Comments
 (0)