All of lore.kernel.org
 help / color / mirror / Atom feed
* [MPTCP] Re: [PATCH] selftests: allow compilation on older systems
@ 2019-10-15 13:29 Matthieu Baerts
  0 siblings, 0 replies; 6+ messages in thread
From: Matthieu Baerts @ 2019-10-15 13:29 UTC (permalink / raw)
  To: mptcp

[-- Attachment #1: Type: text/plain, Size: 1361 bytes --]

Hi Florian, Davide,

On 15/10/2019 14:17, Matthieu Baerts wrote:
> Hi Florian, Davide,
> 
> On 15/10/2019 12:26, Florian Westphal wrote:
>> Davide Caratti <dcaratti(a)redhat.com> wrote:
>>> --- a/tools/testing/selftests/net/mptcp/mptcp_connect.c
>>> +++ b/tools/testing/selftests/net/mptcp/mptcp_connect.c
>>> @@ -18,7 +18,8 @@
>>>   #include <netdb.h>
>>>   #include <netinet/in.h>
>>> -#include <netinet/tcp.h>
>>> +
>>> +#include <linux/tcp.h>
>>>
>>> ^^ this ensures that TCP_ULP is defined, if the 'kernel-headers' package
>>> is newer than 4.13.
>>
>> ii  linux-libc-dev:amd64            4.9.168-1+deb9u5               amd64
>> Linux support headers for userspace development
>>
>> I don't care though, I can carry this patch in my private branch.
> 
> Thank you for the patch and the review.
> I would prefer to apply the patch, it doesn't cost anything to have this 
> in the code.
> 
> If there is no objection from Davide, I am going to apply it. We can 
> still revert later if needed.

- 29950008bd42: "squashed" in "mptcp: add basic kselftest for mptcp"
- a6ac152c2671..d7c09401756b: results

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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [MPTCP] Re: [PATCH] selftests: allow compilation on older systems
@ 2019-10-15 12:36 Matthieu Baerts
  0 siblings, 0 replies; 6+ messages in thread
From: Matthieu Baerts @ 2019-10-15 12:36 UTC (permalink / raw)
  To: mptcp

[-- Attachment #1: Type: text/plain, Size: 1562 bytes --]

Hi Davide,

On 15/10/2019 14:31, Davide Caratti wrote:
> On Tue, 2019-10-15 at 12:26 +0200, Florian Westphal wrote:
>> Davide Caratti <dcaratti(a)redhat.com> wrote:
>>> --- a/tools/testing/selftests/net/mptcp/mptcp_connect.c
>>> +++ b/tools/testing/selftests/net/mptcp/mptcp_connect.c
>>> @@ -18,7 +18,8 @@
>>>   
>>>   #include <netdb.h>
>>>   #include <netinet/in.h>
>>> -#include <netinet/tcp.h>
>>> +
>>> +#include <linux/tcp.h>
>>>
>>> ^^ this ensures that TCP_ULP is defined, if the 'kernel-headers' package
>>> is newer than 4.13.
>>
>> ii  linux-libc-dev:amd64            4.9.168-1+deb9u5               amd64
>> Linux support headers for userspace development
>>
>> I don't care though, I can carry this patch in my private branch.
> 
> we can also keep this patch merged until the whole thing is addressed
> entirely (because the same argument also applies to the definition of
> IPPROTO_MPTCP)-

There is already something for IPPROTO_MPTCP:

   #ifndef IPPROTO_MPTCP
   #define IPPROTO_MPTCP 262
   #endif

> the patch LGTM and probably it also fixes a build failure on some system,
> like Florian's Debian, that has been introduced with "selftests: test
> setsockopt(..., TCP_ULP, "mptcp", ...)".

Did you introduce this on purpose to make sure Florian would be forced 
not to use Debian but RHEL/Fedora??? Sneaky!!

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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [MPTCP] Re: [PATCH] selftests: allow compilation on older systems
@ 2019-10-15 12:31 Davide Caratti
  0 siblings, 0 replies; 6+ messages in thread
From: Davide Caratti @ 2019-10-15 12:31 UTC (permalink / raw)
  To: mptcp

[-- Attachment #1: Type: text/plain, Size: 1067 bytes --]

On Tue, 2019-10-15 at 12:26 +0200, Florian Westphal wrote:
> Davide Caratti <dcaratti(a)redhat.com> wrote:
> > --- a/tools/testing/selftests/net/mptcp/mptcp_connect.c
> > +++ b/tools/testing/selftests/net/mptcp/mptcp_connect.c
> > @@ -18,7 +18,8 @@
> >  
> >  #include <netdb.h>
> >  #include <netinet/in.h>
> > -#include <netinet/tcp.h>
> > +
> > +#include <linux/tcp.h>
> > 
> > ^^ this ensures that TCP_ULP is defined, if the 'kernel-headers' package
> > is newer than 4.13.
> 
> ii  linux-libc-dev:amd64            4.9.168-1+deb9u5               amd64
> Linux support headers for userspace development
> 
> I don't care though, I can carry this patch in my private branch.

we can also keep this patch merged until the whole thing is addressed
entirely (because the same argument also applies to the definition of
IPPROTO_MPTCP)-

the patch LGTM and probably it also fixes a build failure on some system,
like Florian's Debian, that has been introduced with "selftests: test
setsockopt(..., TCP_ULP, "mptcp", ...)".

Ok?
-- 
davide

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [MPTCP] Re: [PATCH] selftests: allow compilation on older systems
@ 2019-10-15 12:17 Matthieu Baerts
  0 siblings, 0 replies; 6+ messages in thread
From: Matthieu Baerts @ 2019-10-15 12:17 UTC (permalink / raw)
  To: mptcp

[-- Attachment #1: Type: text/plain, Size: 1126 bytes --]

Hi Florian, Davide,

On 15/10/2019 12:26, Florian Westphal wrote:
> Davide Caratti <dcaratti(a)redhat.com> wrote:
>> --- a/tools/testing/selftests/net/mptcp/mptcp_connect.c
>> +++ b/tools/testing/selftests/net/mptcp/mptcp_connect.c
>> @@ -18,7 +18,8 @@
>>   
>>   #include <netdb.h>
>>   #include <netinet/in.h>
>> -#include <netinet/tcp.h>
>> +
>> +#include <linux/tcp.h>
>>
>> ^^ this ensures that TCP_ULP is defined, if the 'kernel-headers' package
>> is newer than 4.13.
> 
> ii  linux-libc-dev:amd64            4.9.168-1+deb9u5               amd64
> Linux support headers for userspace development
> 
> I don't care though, I can carry this patch in my private branch.

Thank you for the patch and the review.
I would prefer to apply the patch, it doesn't cost anything to have this 
in the code.

If there is no objection from Davide, I am going to apply it. We can 
still revert later if needed.

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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [MPTCP] Re: [PATCH] selftests: allow compilation on older systems
@ 2019-10-15 10:26 Florian Westphal
  0 siblings, 0 replies; 6+ messages in thread
From: Florian Westphal @ 2019-10-15 10:26 UTC (permalink / raw)
  To: mptcp

[-- Attachment #1: Type: text/plain, Size: 598 bytes --]

Davide Caratti <dcaratti(a)redhat.com> wrote:
> --- a/tools/testing/selftests/net/mptcp/mptcp_connect.c
> +++ b/tools/testing/selftests/net/mptcp/mptcp_connect.c
> @@ -18,7 +18,8 @@
>  
>  #include <netdb.h>
>  #include <netinet/in.h>
> -#include <netinet/tcp.h>
> +
> +#include <linux/tcp.h>
> 
> ^^ this ensures that TCP_ULP is defined, if the 'kernel-headers' package
> is newer than 4.13.

ii  linux-libc-dev:amd64            4.9.168-1+deb9u5               amd64
Linux support headers for userspace development

I don't care though, I can carry this patch in my private branch.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [MPTCP] Re: [PATCH] selftests: allow compilation on older systems
@ 2019-10-15  7:37 Davide Caratti
  0 siblings, 0 replies; 6+ messages in thread
From: Davide Caratti @ 2019-10-15  7:37 UTC (permalink / raw)
  To: mptcp

[-- Attachment #1: Type: text/plain, Size: 1365 bytes --]

On Mon, 2019-10-14 at 23:17 +0200, Florian Westphal wrote:
> #ifndef IPPROTO_MPTCP
>  #define IPPROTO_MPTCP 262
>  #endif
> +#ifndef TCP_ULP
> +#define TCP_ULP 31
> +#endif
 

good morning Florian!

AFAIU this is no more needed after 

"selftests: test setsockopt(..., TCP_ULP, "mptcp", ...)"

that had this hunk:

--- a/tools/testing/selftests/net/mptcp/mptcp_connect.c
+++ b/tools/testing/selftests/net/mptcp/mptcp_connect.c
@@ -18,7 +18,8 @@
 
 #include <netdb.h>
 #include <netinet/in.h>
-#include <netinet/tcp.h>
+
+#include <linux/tcp.h>

^^ this ensures that TCP_ULP is defined, if the 'kernel-headers' package
is newer than 4.13.

netinet/tcp.h is provided by glibc-headers (you find a quite old uapi
here), while linux/tcp.h is provided by kernel-headers (you find a newer
version of the uapi, but maybe not the one that defines TCP_ULP).
And if I well remember, the rules in lib.mk should allow installing the
current kernel headers in ${top_srcdir}/usr/include, as per:

commit b2d35fa5fc80c27e868e393dcab4c94a0d71737f
Author: Anders Roxell <anders.roxell(a)linaro.org>
Date:   Tue Sep 4 12:47:21 2018 +0200

    selftests: add headers_install to lib.mk


maybe we can use this to avoid this "#include foo.h -> #ifndef foo ->
#define foo -> #endif" pattern?

any feedback appreciated, thanks
-- 
davide


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2019-10-15 13:29 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-15 13:29 [MPTCP] Re: [PATCH] selftests: allow compilation on older systems Matthieu Baerts
  -- strict thread matches above, loose matches on Subject: below --
2019-10-15 12:36 Matthieu Baerts
2019-10-15 12:31 Davide Caratti
2019-10-15 12:17 Matthieu Baerts
2019-10-15 10:26 Florian Westphal
2019-10-15  7:37 Davide Caratti

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.