Hi Paolo,
On 17/10/2019 16:32, Paolo Abeni wrote:
On Thu, 2019-10-17 at 16:22 +0200, Matthieu Baerts wrote:
> Hi Paolo,
>
> Thank you for the review!
>
> On 17/10/2019 16:18, Paolo Abeni wrote:
>> On Wed, 2019-10-16 at 18:15 +0200, Matthieu Baerts wrote:
>>> net/mptcp/options.c: In function ‘mptcp_established_options_addr’:
>>> net/mptcp/options.c:478:9: error: ‘struct mptcp_out_options’ has no
member named ‘addr6’; did you mean ‘addr’?
>>> 478 | opts->addr6 = ((struct sockaddr_in6
*)&saddr)->sin6_addr;
>>> | ^~~~~
>>> | addr
>>>
>>> Signed-off-by: Matthieu Baerts <matthieu.baerts(a)tessares.net>
>>> ---
>>>
>>> Notes:
>>> To squash in "mptcp: Add ADD_ADDR handling"
>>>
>>> net/mptcp/options.c | 2 ++
>>> 1 file changed, 2 insertions(+)
>>>
>>> diff --git a/net/mptcp/options.c b/net/mptcp/options.c
>>> index c948951509e1..6cfcf2ce44fe 100644
>>> --- a/net/mptcp/options.c
>>> +++ b/net/mptcp/options.c
>>> @@ -470,6 +470,7 @@ static bool mptcp_established_options_addr(struct sock
*sk,
>>> opts->addr_id = id;
>>> opts->addr = ((struct sockaddr_in *)&saddr)->sin_addr;
>>> *size = TCPOLEN_MPTCP_ADD_ADDR;
>>> +#if IS_ENABLED(CONFIG_IPV6)
>>> } else if (saddr.ss_family == AF_INET6) {
>>> if (remaining < TCPOLEN_MPTCP_ADD_ADDR6)
>>> return false;
>>> @@ -477,6 +478,7 @@ static bool mptcp_established_options_addr(struct sock
*sk,
>>> opts->addr_id = id;
>>> opts->addr6 = ((struct sockaddr_in6 *)&saddr)->sin6_addr;
>>> *size = TCPOLEN_MPTCP_ADD_ADDR6;
>>> +#endif
>>
>> I think that the preferred codying style here is something alike:
>>
>> // ipv4 branch
>> }
>> #if IS_ENABLED(CONFIG_IPV6)
>> else if (/* ... */) {
>> // ...
>> }
>> #endif
>>
>> yep, without the preprocess conditional that would be against the
>> codying rules, but looks like checkpatch would be happy here.
>>
>> The rationale is that is more clear in both the patch and the resulting
>> code what is protected by the conditional.
>
> Fine for me! I copied what was done in net/mptcp/basic.c:75
> Do you want me to apply the same change there as well?
Oops... I missed that - and net/mptcp/options.c:587, too.
Which code are you referring to?
https://github.com/multipath-tcp/mptcp_net-next/blob/export/net/mptcp/opt...
I personally would go with what I mentioned above. Since there is a
build to fix, I think we can merge as is for speed's sake, and update
all the places later.
I was already updating the patches. If you don't mind, I am going to
send them and apply the ones that fix the build.
Cheers,
Matt
--
Matthieu Baerts | R&D Engineer
matthieu.baerts(a)tessares.net
Tessares SA | Hybrid Access Solutions
www.tessares.net
1 Avenue Jean Monnet, 1348 Louvain-la-Neuve, Belgium