From: Geliang Tang <geliang.tang@suse.com>
To: Mat Martineau <mathew.j.martineau@linux.intel.com>
Cc: mptcp@lists.linux.dev
Subject: Re: [PATCH mptcp-next v2 1/2] mptcp: use entry->lsk directly
Date: Fri, 28 Oct 2022 19:12:56 +0800 [thread overview]
Message-ID: <20221028111256.GA2511@localhost> (raw)
In-Reply-To: <673ea417-59a7-bc9f-9e09-d290417ceae9@linux.intel.com>
On Thu, Oct 27, 2022 at 12:50:03PM -0700, Mat Martineau wrote:
> On Wed, 26 Oct 2022, Geliang Tang wrote:
>
> > This patch drops msk and ssock in mptcp_pm_nl_create_listen_socket(),
> > use entry->lsk directly instead of ssock.
> >
>
> Hi Geliang -
>
> The change looks good, but the old code looks buggy. Seems like it would be
> trying to re-bind the nmpc socket each time a listener socket was created.
> Is this a fix for mptcp-net in your opinion?
Yes, this should be a fix. Please add this into the -net section when
merging it.
Thanks,
-Geliang
>
>
> Thanks,
>
> Mat
>
> > Signed-off-by: Geliang Tang <geliang.tang@suse.com>
> > ---
> > net/mptcp/pm_netlink.c | 18 ++----------------
> > 1 file changed, 2 insertions(+), 16 deletions(-)
> >
> > diff --git a/net/mptcp/pm_netlink.c b/net/mptcp/pm_netlink.c
> > index 9813ed0fde9b..52a5847b9d74 100644
> > --- a/net/mptcp/pm_netlink.c
> > +++ b/net/mptcp/pm_netlink.c
> > @@ -992,8 +992,6 @@ static int mptcp_pm_nl_create_listen_socket(struct sock *sk,
> > {
> > int addrlen = sizeof(struct sockaddr_in);
> > struct sockaddr_storage addr;
> > - struct mptcp_sock *msk;
> > - struct socket *ssock;
> > int backlog = 1024;
> > int err;
> >
> > @@ -1002,30 +1000,18 @@ static int mptcp_pm_nl_create_listen_socket(struct sock *sk,
> > if (err)
> > return err;
> >
> > - msk = mptcp_sk(entry->lsk->sk);
> > - if (!msk) {
> > - err = -EINVAL;
> > - goto out;
> > - }
> > -
> > - ssock = __mptcp_nmpc_socket(msk);
> > - if (!ssock) {
> > - err = -EINVAL;
> > - goto out;
> > - }
> > -
> > mptcp_info2sockaddr(&entry->addr, &addr, entry->addr.family);
> > #if IS_ENABLED(CONFIG_MPTCP_IPV6)
> > if (entry->addr.family == AF_INET6)
> > addrlen = sizeof(struct sockaddr_in6);
> > #endif
> > - err = kernel_bind(ssock, (struct sockaddr *)&addr, addrlen);
> > + err = kernel_bind(entry->lsk, (struct sockaddr *)&addr, addrlen);
> > if (err) {
> > pr_warn("kernel_bind error, err=%d", err);
> > goto out;
> > }
> >
> > - err = kernel_listen(ssock, backlog);
> > + err = kernel_listen(entry->lsk, backlog);
> > if (err) {
> > pr_warn("kernel_listen error, err=%d", err);
> > goto out;
> > --
> > 2.35.3
> >
> >
> >
>
> --
> Mat Martineau
> Intel
next prev parent reply other threads:[~2022-10-28 11:12 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-10-26 10:45 [PATCH mptcp-next v2 0/2] add pm listener events Geliang Tang
2022-10-26 10:45 ` [PATCH mptcp-next v2 1/2] mptcp: use entry->lsk directly Geliang Tang
2022-10-27 19:50 ` Mat Martineau
2022-10-28 11:12 ` Geliang Tang [this message]
2022-10-31 16:02 ` Matthieu Baerts
2022-10-26 10:45 ` [PATCH mptcp-next v2 2/2] mptcp: add pm listener events Geliang Tang
2022-10-26 12:20 ` mptcp: add pm listener events: Tests Results MPTCP CI
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20221028111256.GA2511@localhost \
--to=geliang.tang@suse.com \
--cc=mathew.j.martineau@linux.intel.com \
--cc=mptcp@lists.linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.