Skip to content

build: detect kernel features when building

Marcelo Ricardo Leitner linux-sctp 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest12 patches 2 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/12build: remove internal copy of kernel headersrc/include/linux/sctp.h+0 -11530 replies
2/12build: add m4 macros to probe for kernel featuresm4/.gitignore m4/sctp.m4+64 -00 replies
3/12configure.ac: style fixesconfigure.ac+5 -20 replies
4/12build: probe for linux/sctp.hconfigure.ac+8 -00 replies
5/12netinet/sctp.h: dynamically build based on system setupconfigure.ac src/include/netinet/Makefile.am src/include/netinet/sctp.h.in+4 -20 replies
6/12build: add define HAVE_SCTP_STREAM_RESET_EVENTconfigure.ac src/include/netinet/sctp.h.in+6 -00 replies
7/12build: add define HAVE_SCTP_ASSOC_RESET_EVENTconfigure.ac src/include/netinet/sctp.h.in+5 -00 replies
8/12build: add define HAVE_SCTP_STREAM_CHANGE_EVENTconfigure.ac src/include/netinet/sctp.h.in+5 -00 replies
9/12build: add define HAVE_SCTP_STREAM_RECONFIGconfigure.ac src/include/netinet/sctp.h.in+4 -00 replies
10/12build: add define HAVE_SCTP_PEELOFF_FLAGSconfigure.ac src/include/netinet/sctp.h.in src/lib/peeloff.c+27 -150 replies
11/12build: add two defines for Partial Delivery extensions on sctp_pdapi_evenconfigure.ac src/include/netinet/sctp.h.in+8 -00 replies
12/12build: add define HAVE_SCTP_SENDVconfigure.ac src/func_tests/Makefile.am src/include/netinet/sctp.h.in +3 more+27 -20 replies

Reviews trailers per patch

None of the 12 patches has a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchNeil Horman
SeriesA-b
1/12
2/12
3/12
4/12
5/12
6/12
7/12
8/12
9/12
10/12
11/12
12/12

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH lksctp-tools 00/12] build: detect kernel features when building

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%)
Signature · 1 line
2.14.3