Failed to build SCTP programs against Linux 5.0 kernel headers
liuqun opened this issue · comments
On Ubuntu 19.04 with Linux 5.0 kernel,
the kernel header file /usr/include/linux/sctp.h
added the following line:
#define SCTP_EVENT 127
This breaks the following code that rely on the SCTP_EVENT
micro which were disabled in the past (Linux 4.18 kernel).
DTLS-Examples/src/dtls_sctp_chargen.c
Lines 584 to 599 in 114cb15
On Ubuntu 19.04 I got such gcc error:
$ make
cc -std=c99 -pedantic -Wall -g -Wextra -Wno-unused-parameter -Wno-unused-function -Wno-overlength-strings -I/usr/local/include -o dtls_sctp_chargen dtls_sctp_chargen.c -L/usr/local/lib -lssl -lcrypto -pthread -lm -ldl
dtls_sctp_chargen.c: In function ‘start_server’:
dtls_sctp_chargen.c:586:23: error: ‘SCTP_FUTURE_ASSOC’ undeclared (first use in this function); did you mean ‘SCTP_RESET_ASSOC’?
event.se_assoc_id = SCTP_FUTURE_ASSOC;
^~~~~~~~~~~~~~~~~
SCTP_RESET_ASSOC
dtls_sctp_chargen.c:586:23: note: each undeclared identifier is reported only once for each function it appears in
...
$ uname -a
Linux vmware 5.0.0-15-generic #16-Ubuntu SMP Mon May 6 17:41:33 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
header file /usr/include/netinet/sctp.h
provided by libsctp-dev relies on /usr/include/linux/sctp.h
.
And there is NO definition of SCTP_FUTURE_ASSOC
in any version of Linux kernel headers (4.18.x-5.0.x).
I guess the SCTP_FUTURE_ASSOC
only came with freebsd kernel...
Thanks for the report.
You're right, the defines for SCTP_FUTURE_ASSOC
, SCTP_CURRENT_ASSOC
and SCTP_ALL_ASSOC
are missing in Linux Kernel 5.0.
They are defined in version 5.1.
We'll evaluate the issue and report back.