linux-sctp.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH lksctp-tools 00/12] build: detect kernel features when building
@ 2018-05-30 17:17 Marcelo Ricardo Leitner
  2018-05-31 15:41 ` Neil Horman
  2018-06-04 20:19 ` Marcelo Ricardo Leitner
  0 siblings, 2 replies; 3+ messages in thread
From: Marcelo Ricardo Leitner @ 2018-05-30 17:17 UTC (permalink / raw)
  To: linux-sctp

Currently we have an issue with struct sctp_event_subscribe. Kernel
won't accept any buffer larger than the version of sctp_event_subscribe
that is expects, and because of that we cannot simply have a copy of
kernel headers inside lksctp-tools. If we do, we have no way to use the
right version of sctp_event_subscribe.

That pretty much means that currently one has to tweak the internal copy
to comply with what the kernel one is using, which is really not good.

This patchset introduces probing of kernel features during build time
into lksctp-tools. With that, we can tell the applications that this or
that feature is enabled or not in the environment that it was compiled
on.

With the removal of the internal copy, other issues came up. Such as the
usage of sctp_peeloff_flags_arg_t by default, regardless of the kernel
being used. This became an issue because old kernels don't have such
struct, and thus the library doesn't build.

Another example is support for sendv/recv. Even if we use a private copy
with the symbols needed, the lib functions will compile but unit tests
will fail, as such function calls will always return EINVAL.

A check for recent UAPI changes was done by me and Xin Long and this is
the list that we came up with. Hopefully this restores lksctp-tools
compatibility with older kernels.

Fixes https://github.com/sctp/lksctp-tools/issues/24 .

Marcelo Ricardo Leitner (12):
  build: remove internal copy of kernel header
  build: add m4 macros to probe for kernel features
  configure.ac: style fixes
  build: probe for linux/sctp.h
  netinet/sctp.h: dynamically build based on system setup
  build: add define HAVE_SCTP_STREAM_RESET_EVENT
  build: add define HAVE_SCTP_ASSOC_RESET_EVENT
  build: add define HAVE_SCTP_STREAM_CHANGE_EVENT
  build: add define HAVE_SCTP_STREAM_RECONFIG
  build: add define HAVE_SCTP_PEELOFF_FLAGS
  build: add two defines for Partial Delivery extensions on
    sctp_pdapi_event
  build: add define HAVE_SCTP_SENDV

 configure.ac                              |   44 +-
 m4/.gitignore                             |    1 +
 m4/sctp.m4                                |   63 ++
 src/func_tests/Makefile.am                |    9 +-
 src/include/linux/sctp.h                  | 1153 -----------------------------
 src/include/netinet/Makefile.am           |    5 +-
 src/include/netinet/{sctp.h => sctp.h.in} |   15 +
 src/lib/peeloff.c                         |   38 +-
 src/lib/recvmsg.c                         |    2 +
 src/lib/sendmsg.c                         |    2 +
 src/testlib/sctputil.h                    |    5 +
 11 files changed, 163 insertions(+), 1174 deletions(-)
 create mode 100644 m4/sctp.m4
 delete mode 100644 src/include/linux/sctp.h
 rename src/include/netinet/{sctp.h => sctp.h.in} (93%)

-- 
2.14.3


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

* Re: [PATCH lksctp-tools 00/12] build: detect kernel features when building
  2018-05-30 17:17 [PATCH lksctp-tools 00/12] build: detect kernel features when building Marcelo Ricardo Leitner
@ 2018-05-31 15:41 ` Neil Horman
  2018-06-04 20:19 ` Marcelo Ricardo Leitner
  1 sibling, 0 replies; 3+ messages in thread
From: Neil Horman @ 2018-05-31 15:41 UTC (permalink / raw)
  To: linux-sctp

On Wed, May 30, 2018 at 02:17:51PM -0300, Marcelo Ricardo Leitner wrote:
> Currently we have an issue with struct sctp_event_subscribe. Kernel
> won't accept any buffer larger than the version of sctp_event_subscribe
> that is expects, and because of that we cannot simply have a copy of
> kernel headers inside lksctp-tools. If we do, we have no way to use the
> right version of sctp_event_subscribe.
> 
> That pretty much means that currently one has to tweak the internal copy
> to comply with what the kernel one is using, which is really not good.
> 
> This patchset introduces probing of kernel features during build time
> into lksctp-tools. With that, we can tell the applications that this or
> that feature is enabled or not in the environment that it was compiled
> on.
> 
> With the removal of the internal copy, other issues came up. Such as the
> usage of sctp_peeloff_flags_arg_t by default, regardless of the kernel
> being used. This became an issue because old kernels don't have such
> struct, and thus the library doesn't build.
> 
> Another example is support for sendv/recv. Even if we use a private copy
> with the symbols needed, the lib functions will compile but unit tests
> will fail, as such function calls will always return EINVAL.
> 
> A check for recent UAPI changes was done by me and Xin Long and this is
> the list that we came up with. Hopefully this restores lksctp-tools
> compatibility with older kernels.
> 
> Fixes https://github.com/sctp/lksctp-tools/issues/24 .
> 
> Marcelo Ricardo Leitner (12):
>   build: remove internal copy of kernel header
>   build: add m4 macros to probe for kernel features
>   configure.ac: style fixes
>   build: probe for linux/sctp.h
>   netinet/sctp.h: dynamically build based on system setup
>   build: add define HAVE_SCTP_STREAM_RESET_EVENT
>   build: add define HAVE_SCTP_ASSOC_RESET_EVENT
>   build: add define HAVE_SCTP_STREAM_CHANGE_EVENT
>   build: add define HAVE_SCTP_STREAM_RECONFIG
>   build: add define HAVE_SCTP_PEELOFF_FLAGS
>   build: add two defines for Partial Delivery extensions on
>     sctp_pdapi_event
>   build: add define HAVE_SCTP_SENDV
> 
>  configure.ac                              |   44 +-
>  m4/.gitignore                             |    1 +
>  m4/sctp.m4                                |   63 ++
>  src/func_tests/Makefile.am                |    9 +-
>  src/include/linux/sctp.h                  | 1153 -----------------------------
>  src/include/netinet/Makefile.am           |    5 +-
>  src/include/netinet/{sctp.h => sctp.h.in} |   15 +
>  src/lib/peeloff.c                         |   38 +-
>  src/lib/recvmsg.c                         |    2 +
>  src/lib/sendmsg.c                         |    2 +
>  src/testlib/sctputil.h                    |    5 +
>  11 files changed, 163 insertions(+), 1174 deletions(-)
>  create mode 100644 m4/sctp.m4
>  delete mode 100644 src/include/linux/sctp.h
>  rename src/include/netinet/{sctp.h => sctp.h.in} (93%)
> 
> -- 
> 2.14.3
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-sctp" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 
Nice work, this looks good

Acked-by: Neil Horman <nhorman@tuxdriver.com>

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

* Re: [PATCH lksctp-tools 00/12] build: detect kernel features when building
  2018-05-30 17:17 [PATCH lksctp-tools 00/12] build: detect kernel features when building Marcelo Ricardo Leitner
  2018-05-31 15:41 ` Neil Horman
@ 2018-06-04 20:19 ` Marcelo Ricardo Leitner
  1 sibling, 0 replies; 3+ messages in thread
From: Marcelo Ricardo Leitner @ 2018-06-04 20:19 UTC (permalink / raw)
  To: linux-sctp

On Wed, May 30, 2018 at 02:17:51PM -0300, Marcelo Ricardo Leitner wrote:
> Currently we have an issue with struct sctp_event_subscribe. Kernel
> won't accept any buffer larger than the version of sctp_event_subscribe
> that is expects, and because of that we cannot simply have a copy of
> kernel headers inside lksctp-tools. If we do, we have no way to use the
> right version of sctp_event_subscribe.

(late email)
Series applied.

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

end of thread, other threads:[~2018-06-04 20:19 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-05-30 17:17 [PATCH lksctp-tools 00/12] build: detect kernel features when building Marcelo Ricardo Leitner
2018-05-31 15:41 ` Neil Horman
2018-06-04 20:19 ` Marcelo Ricardo Leitner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).