Content-Type: multipart/mixed; boundary="===============7891699018585300413==" MIME-Version: 1.0 From: Matthieu Baerts To: mptcp at lists.01.org Subject: [MPTCP] Re: [PATCH 2/3] mptcp: fix compilation error without IPV6 Date: Thu, 17 Oct 2019 16:43:34 +0200 Message-ID: In-Reply-To: e022e39329e0cca69094282c8440d3cd1c918e53.camel@redhat.com X-Status: X-Keywords: X-UID: 2217 --===============7891699018585300413== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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 =E2=80=98mptcp_established_option= s_addr=E2=80=99: >>>> net/mptcp/options.c:478:9: error: =E2=80=98struct mptcp_out_option= s=E2=80=99 has no member named =E2=80=98addr6=E2=80=99; did you mean =E2=80= =98addr=E2=80=99? >>>> 478 | opts->addr6 =3D ((struct sockaddr_in6 *)&saddr)->sin6_ad= dr; >>>> | ^~~~~ >>>> | addr >>>> >>>> Signed-off-by: Matthieu Baerts >>>> --- >>>> >>>> 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 =3D id; >>>> opts->addr =3D ((struct sockaddr_in *)&saddr)->sin_addr; >>>> *size =3D TCPOLEN_MPTCP_ADD_ADDR; >>>> +#if IS_ENABLED(CONFIG_IPV6) >>>> } else if (saddr.ss_family =3D=3D 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 =3D id; >>>> opts->addr6 =3D ((struct sockaddr_in6 *)&saddr)->sin6_addr; >>>> *size =3D 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/optio= ns.c#L587 > 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 --===============7891699018585300413==--