Skip to content

Commit e9828c5

Browse files
Geliang Tangintel-lab-lkp
authored andcommitted
mptcp: change rem type of set_flags
Generally, in the path manager interfaces, the local address is defined as an mptcp_pm_addr_entry type address, while the remote address is defined as an mptcp_addr_info type one: (struct mptcp_pm_addr_entry *local, struct mptcp_addr_info *remote) But the set_flags() interface uses two mptcp_pm_addr_entry type parameters. This patch changes the second one to mptcp_addr_info type and use helper mptcp_pm_parse_addr() to parse it instead of using mptcp_pm_parse_entry(). Signed-off-by: Geliang Tang <[email protected]>
1 parent 80dc398 commit e9828c5

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

net/mptcp/pm_userspace.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -572,9 +572,9 @@ int mptcp_pm_nl_subflow_destroy_doit(struct sk_buff *skb, struct genl_info *info
572572
int mptcp_userspace_pm_set_flags(struct genl_info *info)
573573
{
574574
struct mptcp_pm_addr_entry loc = { .addr = { .family = AF_UNSPEC }, };
575-
struct mptcp_pm_addr_entry rem = { .addr = { .family = AF_UNSPEC }, };
576575
struct nlattr *attr_rem = info->attrs[MPTCP_PM_ATTR_ADDR_REMOTE];
577576
struct nlattr *attr = info->attrs[MPTCP_PM_ATTR_ADDR];
577+
struct mptcp_addr_info rem = { .family = AF_UNSPEC, };
578578
struct mptcp_pm_addr_entry *entry;
579579
struct mptcp_sock *msk;
580580
u8 lookup_by_id = 0;
@@ -603,11 +603,11 @@ int mptcp_userspace_pm_set_flags(struct genl_info *info)
603603
}
604604

605605
if (attr_rem) {
606-
ret = mptcp_pm_parse_entry(attr_rem, info, false, &rem);
606+
ret = mptcp_pm_parse_addr(attr_rem, info, &rem);
607607
if (ret < 0)
608608
goto set_flags_err;
609609

610-
if (rem.addr.family == AF_UNSPEC) {
610+
if (rem.family == AF_UNSPEC) {
611611
NL_SET_ERR_MSG_ATTR(info->extack, attr_rem,
612612
"invalid remote address family");
613613
ret = -EINVAL;
@@ -634,7 +634,7 @@ int mptcp_userspace_pm_set_flags(struct genl_info *info)
634634
spin_unlock_bh(&msk->pm.lock);
635635

636636
lock_sock(sk);
637-
ret = mptcp_pm_nl_mp_prio_send_ack(msk, &entry->addr, &rem.addr, bkup);
637+
ret = mptcp_pm_nl_mp_prio_send_ack(msk, &entry->addr, &rem, bkup);
638638
release_sock(sk);
639639

640640
set_flags_err:

0 commit comments

Comments
 (0)