Message ID | 6ace2404be8fddc3b5a0f3287ed6895ee7b23700.1627463661.git.geliangtang@xiaomi.com (mailing list archive) |
---|---|
State | Superseded, archived |
Delegated to: | Matthieu Baerts |
Headers | show |
Series | [mptcp-next] Squash to "mptcp: local addresses fullmesh" | expand |
On Wed, 28 Jul 2021, Geliang Tang wrote: > From: Geliang Tang <geliangtang@xiaomi.com> > > Fix the checkpatch.pl warning: > WARNING: networking block comments don't use an empty /* line, use /* Comment... > #28: FILE: net/mptcp/pm_netlink.c:542: > +/* > + * Fill all the local addresses into the three arrays, > > And some more cleanups. > > Signed-off-by: Geliang Tang <geliangtang@xiaomi.com> This one looks good to squash too. Reviewed-by: Mat Martineau <mathew.j.martineau@linux.intel.com> > --- > net/mptcp/pm_netlink.c | 8 +++++--- > 1 file changed, 5 insertions(+), 3 deletions(-) > > diff --git a/net/mptcp/pm_netlink.c b/net/mptcp/pm_netlink.c > index 1b6c4adc5a8a..0b9fa7e6f743 100644 > --- a/net/mptcp/pm_netlink.c > +++ b/net/mptcp/pm_netlink.c > @@ -538,8 +538,7 @@ static void mptcp_pm_nl_subflow_established(struct mptcp_sock *msk) > mptcp_pm_create_subflow_or_signal_addr(msk); > } > > -/* > - * Fill all the local addresses into the three arrays, > +/* Fill all the local addresses into the three arrays, > * addr[], flags[] and ifindex[], > * and return the arrays size. > */ > @@ -583,7 +582,9 @@ static unsigned int fill_local_addresses_vec(struct mptcp_sock *msk, > } > rcu_read_unlock(); > > - /* if the array is empty, fill in the local address */ > + /* If the arrays are empty, fill in the single > + * 'IPADDRANY' local address > + */ > if (!i) { > memset(&local, 0, sizeof(local)); > local.family = msk->pm.remote.family; > @@ -631,6 +632,7 @@ static void mptcp_pm_nl_add_addr_received(struct mptcp_sock *msk) > if (msk->pm.add_addr_accepted >= add_addr_accept_max || > msk->pm.subflows >= subflows_max) > WRITE_ONCE(msk->pm.accept_addr, false); > + > spin_unlock_bh(&msk->pm.lock); > for (i = 0; i < nr; i++) > __mptcp_subflow_connect(sk, &addr[i], &remote, flags[i], ifindex[i]); > -- > 2.31.1 > > > -- Mat Martineau Intel
diff --git a/net/mptcp/pm_netlink.c b/net/mptcp/pm_netlink.c index 1b6c4adc5a8a..0b9fa7e6f743 100644 --- a/net/mptcp/pm_netlink.c +++ b/net/mptcp/pm_netlink.c @@ -538,8 +538,7 @@ static void mptcp_pm_nl_subflow_established(struct mptcp_sock *msk) mptcp_pm_create_subflow_or_signal_addr(msk); } -/* - * Fill all the local addresses into the three arrays, +/* Fill all the local addresses into the three arrays, * addr[], flags[] and ifindex[], * and return the arrays size. */ @@ -583,7 +582,9 @@ static unsigned int fill_local_addresses_vec(struct mptcp_sock *msk, } rcu_read_unlock(); - /* if the array is empty, fill in the local address */ + /* If the arrays are empty, fill in the single + * 'IPADDRANY' local address + */ if (!i) { memset(&local, 0, sizeof(local)); local.family = msk->pm.remote.family; @@ -631,6 +632,7 @@ static void mptcp_pm_nl_add_addr_received(struct mptcp_sock *msk) if (msk->pm.add_addr_accepted >= add_addr_accept_max || msk->pm.subflows >= subflows_max) WRITE_ONCE(msk->pm.accept_addr, false); + spin_unlock_bh(&msk->pm.lock); for (i = 0; i < nr; i++) __mptcp_subflow_connect(sk, &addr[i], &remote, flags[i], ifindex[i]);