From: Geliang Tang <tanggeliang@kylinos.cn>
In mptcp_nl_find_ssk(), 'issk' has already been got through inet_sk(). No
need to use inet6_sk() to get 'pinfo' again, just use issk->pinet6 instead.
This patch also drops this 'pinfo' variable.
Signed-off-by: Geliang Tang <tanggeliang@kylinos.cn>
---
net/mptcp/pm_userspace.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/net/mptcp/pm_userspace.c b/net/mptcp/pm_userspace.c
index e53426a5fc52..de17b18b78fe 100644
--- a/net/mptcp/pm_userspace.c
+++ b/net/mptcp/pm_userspace.c
@@ -465,9 +465,7 @@ static struct sock *mptcp_nl_find_ssk(struct mptcp_sock *msk,
break;
#if IS_ENABLED(CONFIG_MPTCP_IPV6)
case AF_INET6: {
- const struct ipv6_pinfo *pinfo = inet6_sk(ssk);
-
- if (!ipv6_addr_equal(&local->addr6, &pinfo->saddr) ||
+ if (!ipv6_addr_equal(&local->addr6, &issk->pinet6->saddr) ||
!ipv6_addr_equal(&remote->addr6, &ssk->sk_v6_daddr))
continue;
break;
--
2.43.0
On Wed, 2025-01-15 at 17:59 +0800, Geliang Tang wrote:
> From: Geliang Tang <tanggeliang@kylinos.cn>
>
> In mptcp_nl_find_ssk(), 'issk' has already been got through
> inet_sk(). No
> need to use inet6_sk() to get 'pinfo' again, just use issk->pinet6
> instead.
> This patch also drops this 'pinfo' variable.
>
> Signed-off-by: Geliang Tang <tanggeliang@kylinos.cn>
> ---
> net/mptcp/pm_userspace.c | 4 +---
> 1 file changed, 1 insertion(+), 3 deletions(-)
>
> diff --git a/net/mptcp/pm_userspace.c b/net/mptcp/pm_userspace.c
> index e53426a5fc52..de17b18b78fe 100644
> --- a/net/mptcp/pm_userspace.c
> +++ b/net/mptcp/pm_userspace.c
> @@ -465,9 +465,7 @@ static struct sock *mptcp_nl_find_ssk(struct
> mptcp_sock *msk,
> break;
> #if IS_ENABLED(CONFIG_MPTCP_IPV6)
> case AF_INET6: {
> - const struct ipv6_pinfo *pinfo =
> inet6_sk(ssk);
> -
> - if (!ipv6_addr_equal(&local->addr6, &pinfo-
> >saddr) ||
> + if (!ipv6_addr_equal(&local->addr6, &issk-
> >pinet6->saddr) ||
CI reports a warning here:
WARNING: line length of 84 exceeds 80 columns
#27: FILE: net/mptcp/pm_userspace.c:468:
Will update this in the next version.
Thanks,
-Geliang
> !ipv6_addr_equal(&remote->addr6, &ssk-
> >sk_v6_daddr))
> continue;
> break;
Hi Geliang,
16 Jan 2025 03:41:25 Geliang Tang <geliang@kernel.org>:
> On Wed, 2025-01-15 at 17:59 +0800, Geliang Tang wrote:
>> From: Geliang Tang <tanggeliang@kylinos.cn>
>>
>> In mptcp_nl_find_ssk(), 'issk' has already been got through
>> inet_sk(). No
>> need to use inet6_sk() to get 'pinfo' again, just use issk->pinet6
>> instead.
>> This patch also drops this 'pinfo' variable.
>>
>> Signed-off-by: Geliang Tang <tanggeliang@kylinos.cn>
>> ---
>> net/mptcp/pm_userspace.c | 4 +---
>> 1 file changed, 1 insertion(+), 3 deletions(-)
>>
>> diff --git a/net/mptcp/pm_userspace.c b/net/mptcp/pm_userspace.c
>> index e53426a5fc52..de17b18b78fe 100644
>> --- a/net/mptcp/pm_userspace.c
>> +++ b/net/mptcp/pm_userspace.c
>> @@ -465,9 +465,7 @@ static struct sock *mptcp_nl_find_ssk(struct
>> mptcp_sock *msk,
>> break;
>> #if IS_ENABLED(CONFIG_MPTCP_IPV6)
>> case AF_INET6: {
>> - const struct ipv6_pinfo *pinfo =
>> inet6_sk(ssk);
>> -
>> - if (!ipv6_addr_equal(&local->addr6, &pinfo-
>>> saddr) ||
>> + if (!ipv6_addr_equal(&local->addr6, &issk-
>>> pinet6->saddr) ||
>
> CI reports a warning here:
>
> WARNING: line length of 84 exceeds 80 columns
> #27: FILE: net/mptcp/pm_userspace.c:468:
Please note that this is a recommendation and not a strict rule.
It means that if going a bit over 80 helps for the clarity, that's
fine: no need to break lines and have something hard to read.
So up to you: check how it looks like when breaking the lines
before 80 characters.
Cheers,
Matt
Hi Matt,
On Thu, 2025-01-16 at 08:31 +0100, Matthieu Baerts wrote:
> Hi Geliang,
>
> 16 Jan 2025 03:41:25 Geliang Tang <geliang@kernel.org>:
>
> > On Wed, 2025-01-15 at 17:59 +0800, Geliang Tang wrote:
> > > From: Geliang Tang <tanggeliang@kylinos.cn>
> > >
> > > In mptcp_nl_find_ssk(), 'issk' has already been got through
> > > inet_sk(). No
> > > need to use inet6_sk() to get 'pinfo' again, just use issk-
> > > >pinet6
> > > instead.
> > > This patch also drops this 'pinfo' variable.
> > >
> > > Signed-off-by: Geliang Tang <tanggeliang@kylinos.cn>
> > > ---
> > > net/mptcp/pm_userspace.c | 4 +---
> > > 1 file changed, 1 insertion(+), 3 deletions(-)
> > >
> > > diff --git a/net/mptcp/pm_userspace.c b/net/mptcp/pm_userspace.c
> > > index e53426a5fc52..de17b18b78fe 100644
> > > --- a/net/mptcp/pm_userspace.c
> > > +++ b/net/mptcp/pm_userspace.c
> > > @@ -465,9 +465,7 @@ static struct sock *mptcp_nl_find_ssk(struct
> > > mptcp_sock *msk,
> > > break;
> > > #if IS_ENABLED(CONFIG_MPTCP_IPV6)
> > > case AF_INET6: {
> > > - const struct ipv6_pinfo *pinfo =
> > > inet6_sk(ssk);
> > > -
> > > - if (!ipv6_addr_equal(&local->addr6, &pinfo-
> > > > saddr) ||
> > > + if (!ipv6_addr_equal(&local->addr6, &issk-
> > > > pinet6->saddr) ||
> >
> > CI reports a warning here:
> >
> > WARNING: line length of 84 exceeds 80 columns
> > #27: FILE: net/mptcp/pm_userspace.c:468:
>
> Please note that this is a recommendation and not a strict rule.
> It means that if going a bit over 80 helps for the clarity, that's
> fine: no need to break lines and have something hard to read.
>
> So up to you: check how it looks like when breaking the lines
> before 80 characters.
If so, I prefer not to break the lines and ignore this warning
(recommendation).
Thanks,
-Geliang
>
> Cheers,
> Matt
© 2016 - 2026 Red Hat, Inc.