From cc1325cb3a16d1330ccacd88b2f2802fbc3581dd Mon Sep 17 00:00:00 2001 From: shirely16 <1360148247@qq.com> Date: Wed, 15 Jul 2020 15:55:43 +0800 Subject: [PATCH] update to lksctp-tools-1.0.18 --- bugfix-Fix-error-errno-typos.patch | 41 ++++++ bugfix-automake-errno-tests.patch | 117 ---------------- ...lude-dir-for-the-now-autogenerated-h.patch | 96 ++++++++++++++ ...0dce7a36fb-actually-belongs-to-v4-19.patch | 31 +++++ ...fix-netinet-sctp-not-to-be-installed.patch | 35 +++++ ...uild-fix-probing-for-HAVE-SCTP-SENDV.patch | 35 +++++ bugfix-build-issue.patch | 80 ----------- ...e-secondary-defines-in-favor-of-HAVE.patch | 52 ++++++++ ...CURRENT-REVISION-and-AGE-for-libsctp.patch | 71 ++++++++++ ...unc-tests-fix-use-of-unitialized-var.patch | 44 ++++++ bugfix-sctp-recvmsg-man-update.patch | 37 ++++++ bugfix-withsctp-and-configure.patch | 72 ---------- ...reuse-PACKAGE-VERSION-as-lib-version.patch | 46 +++++++ ...sctp-use-PACKAGE-VERSION-in-withsctp.patch | 43 ++++++ lksctp-tools.spec | 125 +++++++++--------- 15 files changed, 594 insertions(+), 331 deletions(-) create mode 100644 bugfix-Fix-error-errno-typos.patch delete mode 100644 bugfix-automake-errno-tests.patch create mode 100644 bugfix-automake-fix-include-dir-for-the-now-autogenerated-h.patch create mode 100644 bugfix-build-0b0dce7a36fb-actually-belongs-to-v4-19.patch create mode 100644 bugfix-build-fix-netinet-sctp-not-to-be-installed.patch create mode 100644 bugfix-build-fix-probing-for-HAVE-SCTP-SENDV.patch delete mode 100644 bugfix-build-issue.patch create mode 100644 bugfix-build-remove-secondary-defines-in-favor-of-HAVE.patch create mode 100644 bugfix-configure-add-CURRENT-REVISION-and-AGE-for-libsctp.patch create mode 100644 bugfix-func-tests-fix-use-of-unitialized-var.patch create mode 100644 bugfix-sctp-recvmsg-man-update.patch delete mode 100644 bugfix-withsctp-and-configure.patch create mode 100644 bugfix-withsctp-to-not-reuse-PACKAGE-VERSION-as-lib-version.patch create mode 100644 bugfix-withsctp-use-PACKAGE-VERSION-in-withsctp.patch diff --git a/bugfix-Fix-error-errno-typos.patch b/bugfix-Fix-error-errno-typos.patch new file mode 100644 index 0000000..b77829b --- /dev/null +++ b/bugfix-Fix-error-errno-typos.patch @@ -0,0 +1,41 @@ +From f0183c87b15a9b1ad06db88325d7e5eeddb89c7f Mon Sep 17 00:00:00 2001 +From: Jianwen Ji +Date: Tue, 18 Dec 2018 14:40:37 +0800 +Subject: [PATCH 08/11] Fix error->errno typos + +Signed-off-by: Jianwen Ji +Signed-off-by: Marcelo Ricardo Leitner +--- + src/apps/sctp_status.c | 2 +- + src/apps/sctp_test.c | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/src/apps/sctp_status.c b/src/apps/sctp_status.c +index 46e9ca2..8563cbe 100644 +--- a/src/apps/sctp_status.c ++++ b/src/apps/sctp_status.c +@@ -529,7 +529,7 @@ int receive_r(int sk) + DEBUG_PRINT(DEBUG_MIN, "\trecvmsg(sk=%d) ", sk); + + error = recvmsg(sk, &inmessage, MSG_WAITALL); +- if (error < 0 && error != EAGAIN) { ++ if (error < 0 && errno != EAGAIN) { + fprintf(stderr, "\n\t\t*** recvmsg: %s ***\n\n", + strerror(errno)); + fflush(stdout); +diff --git a/src/apps/sctp_test.c b/src/apps/sctp_test.c +index 4aa2d13..cd7654b 100644 +--- a/src/apps/sctp_test.c ++++ b/src/apps/sctp_test.c +@@ -870,7 +870,7 @@ int receive_r(int sk, int once) + DEBUG_PRINT(DEBUG_MIN, "\trecvmsg(sk=%d) ", sk); + + error = recvmsg(recvsk, &inmessage, MSG_WAITALL); +- if (error < 0 && error != EAGAIN) { ++ if (error < 0 && errno != EAGAIN) { + if (errno == ENOTCONN && socket_type == SOCK_STREAM && + role == SERVER) { + printf("No association is present now!!\n"); +-- +1.8.3.1 + diff --git a/bugfix-automake-errno-tests.patch b/bugfix-automake-errno-tests.patch deleted file mode 100644 index f036319..0000000 --- a/bugfix-automake-errno-tests.patch +++ /dev/null @@ -1,117 +0,0 @@ -From 356de6906c5b6d563f2d0568e86e3875ad482c66 Mon Sep 17 00:00:00 2001 -From: Marcelo Ricardo Leitner -Date: Wed, 26 Sep 2018 13:46:58 -0300 -Subject: [PATCH] func_tests: fix use of unitialized var - -From f0183c87b15a9b1ad06db88325d7e5eeddb89c7f Mon Sep 17 00:00:00 2001 -From: Jianwen Ji -Date: Tue, 18 Dec 2018 14:40:37 +0800 -Subject: [PATCH] Fix error->errno typos - -From 200eca7f1419b1ae53958b51e8551f7e7f6cd467 Mon Sep 17 00:00:00 2001 -From: Marcelo Ricardo Leitner -Date: Tue, 30 Apr 2019 11:31:59 -0300 -Subject: [PATCH] automake: fix include dir for the now autogenerated header - -diff -Naur a/src/apps/Makefile.am b/src/apps/Makefile.am ---- a/src/apps/Makefile.am 2020-07-01 17:01:04.452069819 +0800 -+++ b/src/apps/Makefile.am 2020-07-01 17:16:30.203758750 +0800 -@@ -4,7 +4,7 @@ - include $(top_srcdir)/Makefile.dirs - - # General compilation flags --AM_CPPFLAGS = -I. -I$(top_srcdir)/src/include -I$(top_srcdir)/src/testlib \ -+AM_CPPFLAGS = -I. -I$(top_builddir)/src/include -I$(top_srcdir)/src/testlib \ - -g -O2 -fno-strict-aliasing -Wall -Wstrict-prototypes \ - -Wimplicit-function-declaration - -diff -Naur a/src/apps/sctp_status.c b/src/apps/sctp_status.c ---- a/src/apps/sctp_status.c 2020-07-01 17:01:04.442069801 +0800 -+++ b/src/apps/sctp_status.c 2020-07-01 17:14:37.943559239 +0800 -@@ -529,7 +529,7 @@ - DEBUG_PRINT(DEBUG_MIN, "\trecvmsg(sk=%d) ", sk); - - error = recvmsg(sk, &inmessage, MSG_WAITALL); -- if (error < 0 && error != EAGAIN) { -+ if (error < 0 && errno != EAGAIN) { - fprintf(stderr, "\n\t\t*** recvmsg: %s ***\n\n", - strerror(errno)); - fflush(stdout); -diff -Naur a/src/apps/sctp_test.c b/src/apps/sctp_test.c ---- a/src/apps/sctp_test.c 2020-07-01 17:01:04.442069801 +0800 -+++ b/src/apps/sctp_test.c 2020-07-01 17:15:35.263661098 +0800 -@@ -870,7 +870,7 @@ - DEBUG_PRINT(DEBUG_MIN, "\trecvmsg(sk=%d) ", sk); - - error = recvmsg(recvsk, &inmessage, MSG_WAITALL); -- if (error < 0 && error != EAGAIN) { -+ if (error < 0 && errno != EAGAIN) { - if (errno == ENOTCONN && socket_type == SOCK_STREAM && - role == SERVER) { - printf("No association is present now!!\n"); -diff -Naur a/src/func_tests/Makefile.am b/src/func_tests/Makefile.am ---- a/src/func_tests/Makefile.am 2020-07-01 17:01:04.442069801 +0800 -+++ b/src/func_tests/Makefile.am 2020-07-01 17:17:00.143811975 +0800 -@@ -4,7 +4,7 @@ - include $(top_srcdir)/Makefile.dirs - - # General compilation flags --AM_CPPFLAGS = -I. -I$(top_srcdir)/src/include -I$(top_srcdir)/src/testlib \ -+AM_CPPFLAGS = -I. -I$(top_builddir)/src/include -I$(top_srcdir)/src/testlib \ - -g -O2 -fno-strict-aliasing -Wall -Wstrict-prototypes \ - -Wimplicit-function-declaration - -diff -Naur a/src/func_tests/test_1_to_1_events.c b/src/func_tests/test_1_to_1_events.c ---- a/src/func_tests/test_1_to_1_events.c 2020-07-01 17:01:04.442069801 +0800 -+++ b/src/func_tests/test_1_to_1_events.c 2020-07-01 17:13:38.323453320 +0800 -@@ -92,9 +92,13 @@ - /* Create the client socket. */ - clt_sk = test_socket(AF_INET, SOCK_STREAM, IPPROTO_SCTP); - -- event.sctp_data_io_event = 1; -+ memset(&event, 0, sizeof(event)); -+ event.sctp_data_io_event = 1; - event.sctp_association_event = 1; - event.sctp_shutdown_event = 1; -+#ifdef HAVE_SCTP_AUTH_NO_AUTH -+ event.sctp_authentication_event = 1; -+#endif - len = sizeof(struct sctp_event_subscribe); - test_setsockopt(svr_sk, SCTP_EVENTS, &event, len); - test_setsockopt(clt_sk, SCTP_EVENTS, &event, len); -diff -Naur a/src/lib/Makefile.am b/src/lib/Makefile.am ---- a/src/lib/Makefile.am 2020-07-01 17:01:04.442069801 +0800 -+++ b/src/lib/Makefile.am 2020-07-01 17:17:39.323881637 +0800 -@@ -4,7 +4,7 @@ - include $(top_srcdir)/Makefile.dirs - - # General compilation flags --AM_CPPFLAGS = -I$(top_srcdir)/src/include -+AM_CPPFLAGS = -I$(top_builddir)/src/include - - lib_LTLIBRARIES = libsctp.la - -diff -Naur a/src/testlib/Makefile.am b/src/testlib/Makefile.am ---- a/src/testlib/Makefile.am 2020-07-01 17:01:04.442069801 +0800 -+++ b/src/testlib/Makefile.am 2020-07-01 17:18:13.873943075 +0800 -@@ -5,7 +5,7 @@ - include $(top_srcdir)/Makefile.dirs - - # General compilation flags --AM_CPPFLAGS = -I$(top_srcdir)/src/include -+AM_CPPFLAGS = -I$(top_builddir)/src/include - - noinst_LTLIBRARIES = libsctputil.la - libsctputil_la_SOURCES = sctputil.c sctputil.h -diff -Naur a/src/withsctp/Makefile.am b/src/withsctp/Makefile.am ---- a/src/withsctp/Makefile.am 2020-07-01 17:01:04.452069819 +0800 -+++ b/src/withsctp/Makefile.am 2020-07-01 17:18:39.673988960 +0800 -@@ -10,7 +10,7 @@ - bin_PROGRAMS = checksctp - bin_SCRIPTS = withsctp - --AM_CPPFLAGS=-I$(top_srcdir)/src/include -+AM_CPPFLAGS=-I$(top_builddir)/src/include - pkglib_LTLIBRARIES = libwithsctp.la - libwithsctp_la_SOURCES = sctp_load_libs.c sctp_socket.c sctp_bind.c \ - sctp_sockopt.c sctp_socket.h diff --git a/bugfix-automake-fix-include-dir-for-the-now-autogenerated-h.patch b/bugfix-automake-fix-include-dir-for-the-now-autogenerated-h.patch new file mode 100644 index 0000000..5414450 --- /dev/null +++ b/bugfix-automake-fix-include-dir-for-the-now-autogenerated-h.patch @@ -0,0 +1,96 @@ +From 200eca7f1419b1ae53958b51e8551f7e7f6cd467 Mon Sep 17 00:00:00 2001 +From: Marcelo Ricardo Leitner +Date: Tue, 30 Apr 2019 11:31:59 -0300 +Subject: [PATCH 11/11] automake: fix include dir for the now autogenerated + header + +After 9607dd85e70a ("netinet/sctp.h: dynamically build based on system +setup") the header file is generated on the builddir and won't be +located in the srcdir anymore. This broke builds using different dirs +for building other than the src dir. + +Fix it by telling automake to use the include dir based on top_builddir +instead. + +Fixes #30 + +Fixes: 9607dd85e70a ("netinet/sctp.h: dynamically build based on system setup") +Reported-by: Alexander Gallego +Acked-by: Neil Horman +Signed-off-by: Marcelo Ricardo Leitner +--- + src/apps/Makefile.am | 2 +- + src/func_tests/Makefile.am | 2 +- + src/lib/Makefile.am | 2 +- + src/testlib/Makefile.am | 2 +- + src/withsctp/Makefile.am | 2 +- + 5 files changed, 5 insertions(+), 5 deletions(-) + +diff --git a/src/apps/Makefile.am b/src/apps/Makefile.am +index 7e33b9c..7e32306 100644 +--- a/src/apps/Makefile.am ++++ b/src/apps/Makefile.am +@@ -4,7 +4,7 @@ include $(top_srcdir)/Makefile.rules + include $(top_srcdir)/Makefile.dirs + + # General compilation flags +-AM_CPPFLAGS = -I. -I$(top_srcdir)/src/include -I$(top_srcdir)/src/testlib \ ++AM_CPPFLAGS = -I. -I$(top_builddir)/src/include -I$(top_srcdir)/src/testlib \ + -g -O2 -fno-strict-aliasing -Wall -Wstrict-prototypes \ + -Wimplicit-function-declaration + +diff --git a/src/func_tests/Makefile.am b/src/func_tests/Makefile.am +index 495adcf..e5bf454 100644 +--- a/src/func_tests/Makefile.am ++++ b/src/func_tests/Makefile.am +@@ -4,7 +4,7 @@ include $(top_srcdir)/Makefile.rules + include $(top_srcdir)/Makefile.dirs + + # General compilation flags +-AM_CPPFLAGS = -I. -I$(top_srcdir)/src/include -I$(top_srcdir)/src/testlib \ ++AM_CPPFLAGS = -I. -I$(top_builddir)/src/include -I$(top_srcdir)/src/testlib \ + -g -O2 -fno-strict-aliasing -Wall -Wstrict-prototypes \ + -Wimplicit-function-declaration + +diff --git a/src/lib/Makefile.am b/src/lib/Makefile.am +index 1d62175..1296caa 100644 +--- a/src/lib/Makefile.am ++++ b/src/lib/Makefile.am +@@ -4,7 +4,7 @@ include $(top_srcdir)/Makefile.rules + include $(top_srcdir)/Makefile.dirs + + # General compilation flags +-AM_CPPFLAGS = -I$(top_srcdir)/src/include ++AM_CPPFLAGS = -I$(top_builddir)/src/include + + lib_LTLIBRARIES = libsctp.la + +diff --git a/src/testlib/Makefile.am b/src/testlib/Makefile.am +index fae6bbc..b949611 100644 +--- a/src/testlib/Makefile.am ++++ b/src/testlib/Makefile.am +@@ -5,7 +5,7 @@ include $(top_srcdir)/Makefile.rules + include $(top_srcdir)/Makefile.dirs + + # General compilation flags +-AM_CPPFLAGS = -I$(top_srcdir)/src/include ++AM_CPPFLAGS = -I$(top_builddir)/src/include + + noinst_LTLIBRARIES = libsctputil.la + libsctputil_la_SOURCES = sctputil.c sctputil.h +diff --git a/src/withsctp/Makefile.am b/src/withsctp/Makefile.am +index 1f6ca37..3157588 100644 +--- a/src/withsctp/Makefile.am ++++ b/src/withsctp/Makefile.am +@@ -10,7 +10,7 @@ include $(top_srcdir)/Makefile.rules + bin_PROGRAMS = checksctp + bin_SCRIPTS = withsctp + +-AM_CPPFLAGS=-I$(top_srcdir)/src/include ++AM_CPPFLAGS=-I$(top_builddir)/src/include + pkglib_LTLIBRARIES = libwithsctp.la + libwithsctp_la_SOURCES = sctp_load_libs.c sctp_socket.c sctp_bind.c \ + sctp_sockopt.c sctp_socket.h +-- +1.8.3.1 + diff --git a/bugfix-build-0b0dce7a36fb-actually-belongs-to-v4-19.patch b/bugfix-build-0b0dce7a36fb-actually-belongs-to-v4-19.patch new file mode 100644 index 0000000..06b237f --- /dev/null +++ b/bugfix-build-0b0dce7a36fb-actually-belongs-to-v4-19.patch @@ -0,0 +1,31 @@ +From e5952a0cdfa8b1b56a5823574835f1f771f14ae0 Mon Sep 17 00:00:00 2001 +From: Marcelo Ricardo Leitner +Date: Fri, 24 Aug 2018 09:53:00 -0300 +Subject: [PATCH 06/11] build: 0b0dce7a36fb actually belongs to v4.19 + +Typo or not, this commit actually belongs to v4.19 and made me wonder why +on v4.18 it didn't find this feature. + +Fixes: 817f0bfa248f ("build: add two defines for Peer Address Parameters extensions on sctp_paddrparams") +Signed-off-by: Marcelo Ricardo Leitner +Reviewed-by: Xin Long +--- + configure.ac | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/configure.ac b/configure.ac +index f55775a..5de5c76 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -101,7 +101,7 @@ LKSCTP_CHECK_TYPE([struct sctp_prinfo], [HAVE_SCTP_SENDV]) + # added on v4.16, 30f6ebf65bc4 + LKSCTP_CHECK_DECL([SCTP_AUTH_NO_AUTH], [HAVE_SCTP_AUTH_NO_AUTH]) + +-# New members to sctp_paddrparams, added on v4.18, 0b0dce7a36fb ++# New members to sctp_paddrparams, added on v4.19, 0b0dce7a36fb + LKSCTP_CHECK_MEMBER([struct sctp_paddrparams.spp_ipv6_flowlabel], + [HAVE_SCTP_SPP_IPV6_FLOWLABEL]) + LKSCTP_CHECK_MEMBER([struct sctp_paddrparams.spp_dscp], +-- +1.8.3.1 + diff --git a/bugfix-build-fix-netinet-sctp-not-to-be-installed.patch b/bugfix-build-fix-netinet-sctp-not-to-be-installed.patch new file mode 100644 index 0000000..0f804b8 --- /dev/null +++ b/bugfix-build-fix-netinet-sctp-not-to-be-installed.patch @@ -0,0 +1,35 @@ +From 378560050a8f93786c590cc99a55461666205b61 Mon Sep 17 00:00:00 2001 +From: Xin Long +Date: Fri, 24 Aug 2018 01:13:32 +0800 +Subject: [PATCH 03/11] build: fix netinet/sctp.h not to be installed + +After libcnetinet_HEADERS was set to sctp.h.in, netinet/sctp.h can +no longer be installed into ${includedir}. + +Since "AC_CONFIG_HEADERS([src/include/netinet/sctp.h])" is already +added into configure.ac, there's no need to generate sctp.h by +automake. + +So we simply set libcnetinet_HEADERS back to sctp.h. + +Fixes: 9607dd85e70a ("netinet/sctp.h: dynamically build based on system setup") +Signed-off-by: Xin Long +Signed-off-by: Marcelo Ricardo Leitner +--- + src/include/netinet/Makefile.am | 3 +-- + 1 file changed, 1 insertion(+), 2 deletions(-) + +diff --git a/src/include/netinet/Makefile.am b/src/include/netinet/Makefile.am +index ca0aac2..965db8c 100644 +--- a/src/include/netinet/Makefile.am ++++ b/src/include/netinet/Makefile.am +@@ -11,5 +11,4 @@ libcnetinetdir = $(includedir)/netinet + # API. + include_HEADERS = + +-libcnetinet_HEADERS = sctp.h.in +-BUILT_SOURCES = sctp.h ++libcnetinet_HEADERS = sctp.h +-- +1.8.3.1 + diff --git a/bugfix-build-fix-probing-for-HAVE-SCTP-SENDV.patch b/bugfix-build-fix-probing-for-HAVE-SCTP-SENDV.patch new file mode 100644 index 0000000..e139d5d --- /dev/null +++ b/bugfix-build-fix-probing-for-HAVE-SCTP-SENDV.patch @@ -0,0 +1,35 @@ +From 596efd6631b83069d41782fb0ee2d6cf76a50dfa Mon Sep 17 00:00:00 2001 +From: Marcelo Ricardo Leitner +Date: Fri, 24 Aug 2018 09:52:59 -0300 +Subject: [PATCH 05/11] build: fix probing for HAVE_SCTP_SENDV + +Somehow it was using a type that is non-existent. The right one is +sctp_prinfo, introduced on ed63afb8a318 ("sctp: add support for PR-SCTP +Information for sendmsg"), present on v4.17. + +Fixes: 1b798f1ca3b5 ("build: add define HAVE_SCTP_AUTH_NO_AUTH") +Signed-off-by: Marcelo Ricardo Leitner +Reviewed-by: Xin Long +--- + configure.ac | 5 ++--- + 1 file changed, 2 insertions(+), 3 deletions(-) + +diff --git a/configure.ac b/configure.ac +index dad658c..f55775a 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -94,9 +94,8 @@ LKSCTP_CHECK_MEMBER([struct sctp_pdapi_event.pdapi_stream], + LKSCTP_CHECK_MEMBER([struct sctp_pdapi_event.pdapi_seq], + [HAVE_SCTP_PDAPI_EVENT_PDAPI_SEQ]) + +-# PR-SCTP field used to probe for sendv/recvv support, added on v4.17 +-LKSCTP_CHECK_MEMBER([struct sendv_prinfo.sctp_prinfo], +- [HAVE_SCTP_SENDV]) ++# PR-SCTP struct used to probe for sendv/recvv support, added on v4.17 ++LKSCTP_CHECK_TYPE([struct sctp_prinfo], [HAVE_SCTP_SENDV]) + + # This event indicates that the peer does not support SCTP authentication, + # added on v4.16, 30f6ebf65bc4 +-- +1.8.3.1 + diff --git a/bugfix-build-issue.patch b/bugfix-build-issue.patch deleted file mode 100644 index 7f1cc3a..0000000 --- a/bugfix-build-issue.patch +++ /dev/null @@ -1,80 +0,0 @@ -From 378560050a8f93786c590cc99a55461666205b61 Mon Sep 17 00:00:00 2001 -From: Xin Long -Date: Fri, 24 Aug 2018 01:13:32 +0800 -Subject: [PATCH] build: fix netinet/sctp.h not to be installed - -From db6d15bf12a0123e4320e5fd7cb688331dea1bdc Mon Sep 17 00:00:00 2001 -From: Marcelo Ricardo Leitner -Date: Fri, 24 Aug 2018 09:52:58 -0300 -Subject: [PATCH] build: remove v4.12 secondary defines in favor of - HAVE_SCTP_STREAM_RECONFIG - -From 596efd6631b83069d41782fb0ee2d6cf76a50dfa Mon Sep 17 00:00:00 2001 -From: Marcelo Ricardo Leitner -Date: Fri, 24 Aug 2018 09:52:59 -0300 -Subject: [PATCH] build: fix probing for HAVE_SCTP_SENDV - -From e5952a0cdfa8b1b56a5823574835f1f771f14ae0 Mon Sep 17 00:00:00 2001 -From: Marcelo Ricardo Leitner -Date: Fri, 24 Aug 2018 09:53:00 -0300 -Subject: [PATCH] build: 0b0dce7a36fb actually belongs to v4.19 - -diff -Naur a/configure.ac b/configure.ac ---- a/configure.ac 2020-07-01 10:56:38.411772329 +0800 -+++ b/configure.ac 2020-07-01 14:28:33.355511122 +0800 -@@ -75,14 +75,6 @@ - LKSCTP_CHECK_MEMBER([struct sctp_event_subscribe.sctp_stream_reset_event], - [HAVE_SCTP_STREAM_RESET_EVENT]) - --# Support for assoc reset event, added on v4.12, c95129d127c6 --#LKSCTP_CHECK_MEMBER([struct sctp_event_subscribe.sctp_assoc_reset_event], \ --# [HAVE_SCTP_ASSOC_RESET_EVENT]) -- --# Support for stream change event, added on v4.12, b444153fb5a6 --#LKSCTP_CHECK_MEMBER([struct sctp_event_subscribe.sctp_stream_change_event], \ --# [HAVE_SCTP_STREAM_CHANGE_EVENT]) -- - # RFC 6525 (Stream Reconf), finished on v4.12, c0d8bab6ae51 - LKSCTP_CHECK_DECL([SCTP_RECONFIG_SUPPORTED], [HAVE_SCTP_STREAM_RECONFIG]) - -@@ -95,15 +87,14 @@ - LKSCTP_CHECK_MEMBER([struct sctp_pdapi_event.pdapi_seq], - [HAVE_SCTP_PDAPI_EVENT_PDAPI_SEQ]) - --# PR-SCTP field used to probe for sendv/recvv support, added on v4.17 --LKSCTP_CHECK_MEMBER([struct sendv_prinfo.sctp_prinfo], -- [HAVE_SCTP_SENDV]) -+# PR-SCTP struct used to probe for sendv/recvv support, added on v4.17 -+LKSCTP_CHECK_TYPE([struct sctp_prinfo], [HAVE_SCTP_SENDV]) - - # This event indicates that the peer does not support SCTP authentication, - # added on v4.16, 30f6ebf65bc4 - LKSCTP_CHECK_DECL([SCTP_AUTH_NO_AUTH], [HAVE_SCTP_AUTH_NO_AUTH]) - --# New members to sctp_paddrparams, added on v4.18, 0b0dce7a36fb -+# New members to sctp_paddrparams, added on v4.19, 0b0dce7a36fb - LKSCTP_CHECK_MEMBER([struct sctp_paddrparams.spp_ipv6_flowlabel], - [HAVE_SCTP_SPP_IPV6_FLOWLABEL]) - LKSCTP_CHECK_MEMBER([struct sctp_paddrparams.spp_dscp], -diff -Naur a/src/include/netinet/Makefile.am b/src/include/netinet/Makefile.am ---- a/src/include/netinet/Makefile.am 2020-07-01 10:56:38.421772349 +0800 -+++ b/src/include/netinet/Makefile.am 2020-07-01 14:20:14.894642374 +0800 -@@ -11,5 +11,4 @@ - # API. - include_HEADERS = - --libcnetinet_HEADERS = sctp.h.in --BUILT_SOURCES = sctp.h -+libcnetinet_HEADERS = sctp.h -diff -Naur a/src/include/netinet/sctp.h.in b/src/include/netinet/sctp.h.in ---- a/src/include/netinet/sctp.h.in 2020-07-01 10:56:38.421772349 +0800 -+++ b/src/include/netinet/sctp.h.in 2020-07-01 14:25:06.035149487 +0800 -@@ -61,8 +61,6 @@ - #define HAVE_SCTP_CANSET_PRIMARY - - #undef HAVE_SCTP_STREAM_RESET_EVENT --#undef HAVE_SCTP_ASSOC_RESET_EVENT --#undef HAVE_SCTP_STREAM_CHANGE_EVENT - #undef HAVE_SCTP_STREAM_RECONFIG - #undef HAVE_SCTP_PEELOFF_FLAGS - #undef HAVE_SCTP_PDAPI_EVENT_PDAPI_STREAM diff --git a/bugfix-build-remove-secondary-defines-in-favor-of-HAVE.patch b/bugfix-build-remove-secondary-defines-in-favor-of-HAVE.patch new file mode 100644 index 0000000..2a2734b --- /dev/null +++ b/bugfix-build-remove-secondary-defines-in-favor-of-HAVE.patch @@ -0,0 +1,52 @@ +From db6d15bf12a0123e4320e5fd7cb688331dea1bdc Mon Sep 17 00:00:00 2001 +From: Marcelo Ricardo Leitner +Date: Fri, 24 Aug 2018 09:52:58 -0300 +Subject: [PATCH 04/11] build: remove v4.12 secondary defines in favor of + HAVE_SCTP_STREAM_RECONFIG + +These were backups, commented out since beginning. +HAVE_SCTP_STREAM_RECONFIG is enough to identify that these are there, so +lets use only one. + +Signed-off-by: Marcelo Ricardo Leitner +Reviewed-by: Xin Long +--- + configure.ac | 8 -------- + src/include/netinet/sctp.h.in | 2 -- + 2 files changed, 10 deletions(-) + +diff --git a/configure.ac b/configure.ac +index 2ae36ec..dad658c 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -82,14 +82,6 @@ AC_CHECK_FUNCS([bzero gethostbyname gettimeofday memmove memset select socket \ + LKSCTP_CHECK_MEMBER([struct sctp_event_subscribe.sctp_stream_reset_event], + [HAVE_SCTP_STREAM_RESET_EVENT]) + +-# Support for assoc reset event, added on v4.12, c95129d127c6 +-#LKSCTP_CHECK_MEMBER([struct sctp_event_subscribe.sctp_assoc_reset_event], \ +-# [HAVE_SCTP_ASSOC_RESET_EVENT]) +- +-# Support for stream change event, added on v4.12, b444153fb5a6 +-#LKSCTP_CHECK_MEMBER([struct sctp_event_subscribe.sctp_stream_change_event], \ +-# [HAVE_SCTP_STREAM_CHANGE_EVENT]) +- + # RFC 6525 (Stream Reconf), finished on v4.12, c0d8bab6ae51 + LKSCTP_CHECK_DECL([SCTP_RECONFIG_SUPPORTED], [HAVE_SCTP_STREAM_RECONFIG]) + +diff --git a/src/include/netinet/sctp.h.in b/src/include/netinet/sctp.h.in +index c049077..2009f1c 100644 +--- a/src/include/netinet/sctp.h.in ++++ b/src/include/netinet/sctp.h.in +@@ -61,8 +61,6 @@ extern "C" { + #define HAVE_SCTP_CANSET_PRIMARY + + #undef HAVE_SCTP_STREAM_RESET_EVENT +-#undef HAVE_SCTP_ASSOC_RESET_EVENT +-#undef HAVE_SCTP_STREAM_CHANGE_EVENT + #undef HAVE_SCTP_STREAM_RECONFIG + #undef HAVE_SCTP_PEELOFF_FLAGS + #undef HAVE_SCTP_PDAPI_EVENT_PDAPI_STREAM +-- +1.8.3.1 + diff --git a/bugfix-configure-add-CURRENT-REVISION-and-AGE-for-libsctp.patch b/bugfix-configure-add-CURRENT-REVISION-and-AGE-for-libsctp.patch new file mode 100644 index 0000000..cab8368 --- /dev/null +++ b/bugfix-configure-add-CURRENT-REVISION-and-AGE-for-libsctp.patch @@ -0,0 +1,71 @@ +From 7de2bd7e769f10521e3d0c2cb42c6f6b9b505dd0 Mon Sep 17 00:00:00 2001 +From: Xin Long +Date: Thu, 16 Aug 2018 14:12:30 +0800 +Subject: [PATCH 02/11] configure.ac: add CURRENT REVISION and AGE for libsctp + and libwithsctp + +Add CURRENT REVISION and AGE for libsctp and libwithsctp in +configure.ac to update these 2 library version information. + +Compatible with before, they will start from 1:18:0. But each +will get updated according to their definitions in the future. + +Signed-off-by: Xin Long +Acked-by: Neil Horman +Signed-off-by: Marcelo Ricardo Leitner +--- + configure.ac | 7 +++++++ + src/lib/Makefile.am | 7 +++++-- + src/withsctp/Makefile.am | 3 ++- + 3 files changed, 14 insertions(+), 3 deletions(-) + +diff --git a/configure.ac b/configure.ac +index 275ef4e..2ae36ec 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -14,6 +14,13 @@ dnl reduce clutter in the root; if we put it below AM_INIT_AUTOMAKE, + dnl configure will fail ...) + + AC_INIT([lksctp-tools], [1.0.18], [], [], [http://www.lksctp.org/]) ++AC_SUBST(LIBSCTP_CURRENT, 1) ++AC_SUBST(LIBSCTP_REVISION, 18) ++AC_SUBST(LIBSCTP_AGE, 0) ++AC_SUBST(LIBWITHSCTP_CURRENT, 1) ++AC_SUBST(LIBWITHSCTP_REVISION, 18) ++AC_SUBST(LIBWITHSCTP_AGE, 0) ++ + AC_CONFIG_AUX_DIR(bin) + AC_CONFIG_SRCDIR([src/apps/sctp_darn.c]) + AC_CONFIG_HEADERS([config.h]) +diff --git a/src/lib/Makefile.am b/src/lib/Makefile.am +index 6100c56..1d62175 100644 +--- a/src/lib/Makefile.am ++++ b/src/lib/Makefile.am +@@ -8,5 +8,8 @@ AM_CPPFLAGS = -I$(top_srcdir)/src/include + + lib_LTLIBRARIES = libsctp.la + +-libsctp_la_SOURCES = bindx.c connectx.c peeloff.c opt_info.c addrs.c sendmsg.c recvmsg.c Versions.map +-libsctp_la_LDFLAGS = -version-info 1:17:0 -Wl,--version-script=$(srcdir)/Versions.map ++libsctp_la_SOURCES = bindx.c connectx.c peeloff.c opt_info.c \ ++ addrs.c sendmsg.c recvmsg.c Versions.map ++libsctp_la_LDFLAGS = -version-info \ ++ @LIBSCTP_CURRENT@:@LIBSCTP_REVISION@:@LIBSCTP_AGE@ \ ++ -Wl,--version-script=$(srcdir)/Versions.map +diff --git a/src/withsctp/Makefile.am b/src/withsctp/Makefile.am +index 70b1cca..1f6ca37 100644 +--- a/src/withsctp/Makefile.am ++++ b/src/withsctp/Makefile.am +@@ -14,7 +14,8 @@ AM_CPPFLAGS=-I$(top_srcdir)/src/include + pkglib_LTLIBRARIES = libwithsctp.la + libwithsctp_la_SOURCES = sctp_load_libs.c sctp_socket.c sctp_bind.c \ + sctp_sockopt.c sctp_socket.h +-libwithsctp_la_LDFLAGS = -version-info 1:17:0 -ldl ++libwithsctp_la_LDFLAGS = -version-info \ ++ @LIBWITHSCTP_CURRENT@:@LIBWITHSCTP_REVISION@:@LIBWITHSCTP_AGE@ -ldl + + pkgdoc_DATA = sctp_load_libs.c sctp_socket.c sctp_bind.c \ + sctp_sockopt.c sctp_socket.h checksctp.c +-- +1.8.3.1 + diff --git a/bugfix-func-tests-fix-use-of-unitialized-var.patch b/bugfix-func-tests-fix-use-of-unitialized-var.patch new file mode 100644 index 0000000..090e8ae --- /dev/null +++ b/bugfix-func-tests-fix-use-of-unitialized-var.patch @@ -0,0 +1,44 @@ +From 356de6906c5b6d563f2d0568e86e3875ad482c66 Mon Sep 17 00:00:00 2001 +From: Marcelo Ricardo Leitner +Date: Wed, 26 Sep 2018 13:46:58 -0300 +Subject: [PATCH 07/11] func_tests: fix use of unitialized var + +code-share1 reported that test_1_to_1_events was failing with: +./test_1_to_1_events +test_1_to_1_events.c 1 PASS : COMM_UP notification on client socket - SUCCESS +test_1_to_1_events.c 2 PASS : COMM_UP notification on server socket - SUCCESS +test_1_to_1_events.c 3 BROK : Got a datamsg, expecting notification +DUMP_CORE sctputil.c: 187 + +Turns out we were not initializing events, and thus relying on trash in +the stack to enable sctp_authentication_event for us. + +Fixes #25 + +Signed-off-by: Marcelo Ricardo Leitner +Acked-by: Neil Horman +--- + src/func_tests/test_1_to_1_events.c | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/src/func_tests/test_1_to_1_events.c b/src/func_tests/test_1_to_1_events.c +index 46439bf..f758d6f 100644 +--- a/src/func_tests/test_1_to_1_events.c ++++ b/src/func_tests/test_1_to_1_events.c +@@ -92,9 +92,13 @@ main(int argc, char *argv[]) + /* Create the client socket. */ + clt_sk = test_socket(AF_INET, SOCK_STREAM, IPPROTO_SCTP); + ++ memset(&event, 0, sizeof(event)); + event.sctp_data_io_event = 1; + event.sctp_association_event = 1; + event.sctp_shutdown_event = 1; ++#ifdef HAVE_SCTP_AUTH_NO_AUTH ++ event.sctp_authentication_event = 1; ++#endif + len = sizeof(struct sctp_event_subscribe); + test_setsockopt(svr_sk, SCTP_EVENTS, &event, len); + test_setsockopt(clt_sk, SCTP_EVENTS, &event, len); +-- +1.8.3.1 + diff --git a/bugfix-sctp-recvmsg-man-update.patch b/bugfix-sctp-recvmsg-man-update.patch new file mode 100644 index 0000000..7e9db13 --- /dev/null +++ b/bugfix-sctp-recvmsg-man-update.patch @@ -0,0 +1,37 @@ +From af927f86ee709e9e7071db92d00ac8c050939214 Mon Sep 17 00:00:00 2001 +From: Damir Franusic +Date: Fri, 26 Apr 2019 21:39:43 +0200 +Subject: [PATCH 10/11] sctp_recvmsg man update + +* fixes issue #31 + +Signed-off-by: Marcelo Ricardo Leitner +--- + man/sctp_recvmsg.3 | 11 ++++++++++- + 1 file changed, 10 insertions(+), 1 deletion(-) + +diff --git a/man/sctp_recvmsg.3 b/man/sctp_recvmsg.3 +index a7dede1..7854aec 100644 +--- a/man/sctp_recvmsg.3 ++++ b/man/sctp_recvmsg.3 +@@ -44,7 +44,16 @@ message. + .I msg_flags + is a pointer to a integer that is filled with any message flags like + .B MSG_NOTIFICATION or +-.B MSG_EOR. ++.B MSG_EOR. ++The value of ++.I msg_flags ++pointer should be initialized to 0 to avoid unexpected behavior; ++.I msg_flags ++is also used as an input ++.I flags ++argument to ++.I recvmsg ++function. + .SH "RETURN VALUE" + On success, + .BR sctp_recvmsg +-- +1.8.3.1 + diff --git a/bugfix-withsctp-and-configure.patch b/bugfix-withsctp-and-configure.patch deleted file mode 100644 index a6f6d54..0000000 --- a/bugfix-withsctp-and-configure.patch +++ /dev/null @@ -1,72 +0,0 @@ -From 7c0ef4d441b3833e721df58f56e2cb8c81b34df4 Mon Sep 17 00:00:00 2001 -From: Xin Long -Date: Thu, 16 Aug 2018 14:12:01 +0800 -Subject: [PATCH] withsctp: use @PACKAGE_VERSION@ in withsctp.h - -From 79e7e6e4304bdde2922fab4a446b7384e204440e Mon Sep 17 00:00:00 2001 -From: Marcelo Ricardo Leitner -Date: Fri, 21 Dec 2018 10:25:19 -0200 -Subject: [PATCH] withsctp: to not reuse PACKAGE_VERSION as lib version - -From 7de2bd7e769f10521e3d0c2cb42c6f6b9b505dd0 Mon Sep 17 00:00:00 2001 -From: Xin Long -Date: Thu, 16 Aug 2018 14:12:30 +0800 -Subject: [PATCH] configure.ac: add CURRENT REVISION and AGE for libsctp and - libwithsctp - -diff -Naur a/configure.ac b/configure.ac ---- a/configure.ac 2020-07-01 17:01:04.432069782 +0800 -+++ b/configure.ac 2020-07-01 17:05:52.942602240 +0800 -@@ -14,6 +14,13 @@ - dnl configure will fail ...) - - AC_INIT([lksctp-tools], [1.0.18], [], [], [http://www.lksctp.org/]) -+AC_SUBST(LIBSCTP_CURRENT, 1) -+AC_SUBST(LIBSCTP_REVISION, 18) -+AC_SUBST(LIBSCTP_AGE, 0) -+AC_SUBST(LIBWITHSCTP_CURRENT, 1) -+AC_SUBST(LIBWITHSCTP_REVISION, 18) -+AC_SUBST(LIBWITHSCTP_AGE, 0) -+ - AC_CONFIG_AUX_DIR(bin) - AC_CONFIG_SRCDIR([src/apps/sctp_darn.c]) - AC_CONFIG_HEADERS([config.h]) -diff -Naur a/Makefile.rules b/Makefile.rules ---- a/Makefile.rules 2020-07-01 17:01:04.432069782 +0800 -+++ b/Makefile.rules 2020-07-01 17:03:13.642308299 +0800 -@@ -15,4 +15,7 @@ - edit = @sed \ - -e "s|\@bindir\@|$(bindir)|" \ - -e "s|\@libdir\@|$(libdir)|" \ -- -e "s|\@PACKAGE\@|$(PACKAGE)|" -+ -e "s|\@PACKAGE\@|$(PACKAGE)|" \ -+ -e "s|\@LIBWITHSCTP_CURRENT\@|$(LIBWITHSCTP_CURRENT)|" \ -+ -e "s|\@LIBWITHSCTP_REVISION\@|$(LIBWITHSCTP_REVISION)|" \ -+ -e "s|\@LIBWITHSCTP_AGE\@|$(LIBWITHSCTP_AGE)|" -diff -Naur a/src/withsctp/Makefile.am b/src/withsctp/Makefile.am ---- a/src/withsctp/Makefile.am 2020-07-01 17:01:04.452069819 +0800 -+++ b/src/withsctp/Makefile.am 2020-07-01 17:07:39.482798756 +0800 -@@ -14,8 +14,8 @@ - pkglib_LTLIBRARIES = libwithsctp.la - libwithsctp_la_SOURCES = sctp_load_libs.c sctp_socket.c sctp_bind.c \ - sctp_sockopt.c sctp_socket.h --libwithsctp_la_LDFLAGS = -version-info 1:17:0 -ldl -- -+bwithsctp_la_LDFLAGS = -version-info \ -+ @LIBWITHSCTP_CURRENT@:@LIBWITHSCTP_REVISION@:@LIBWITHSCTP_AGE@ -ldl - pkgdoc_DATA = sctp_load_libs.c sctp_socket.c sctp_bind.c \ - sctp_sockopt.c sctp_socket.h checksctp.c - -diff -Naur a/src/withsctp/withsctp.in b/src/withsctp/withsctp.in ---- a/src/withsctp/withsctp.in 2020-07-01 17:01:04.452069819 +0800 -+++ b/src/withsctp/withsctp.in 2020-07-01 17:04:52.962491581 +0800 -@@ -2,7 +2,8 @@ - # -*- sh -*- - LIBDIR=@libdir@/@PACKAGE@ - BINDIR=@bindir@ --export LD_PRELOAD=${LIBDIR}/libwithsctp.so.1.0.17 -+LIBVER=@LIBWITHSCTP_CURRENT@.@LIBWITHSCTP_AGE@.@LIBWITHSCTP_REVISION@ -+export LD_PRELOAD=${LIBDIR}/libwithsctp.so.${LIBVER} - if ! ${BINDIR}/checksctp 2> /dev/null - then - ${BINDIR}/checksctp; diff --git a/bugfix-withsctp-to-not-reuse-PACKAGE-VERSION-as-lib-version.patch b/bugfix-withsctp-to-not-reuse-PACKAGE-VERSION-as-lib-version.patch new file mode 100644 index 0000000..d0235fe --- /dev/null +++ b/bugfix-withsctp-to-not-reuse-PACKAGE-VERSION-as-lib-version.patch @@ -0,0 +1,46 @@ +From 79e7e6e4304bdde2922fab4a446b7384e204440e Mon Sep 17 00:00:00 2001 +From: Marcelo Ricardo Leitner +Date: Fri, 21 Dec 2018 10:25:19 -0200 +Subject: [PATCH 09/11] withsctp: to not reuse PACKAGE_VERSION as lib version + +Currently and likely in the future, they resolv to the same value, but +conceptually speaking they are different things. As we introduced +dedicated variables for libsctp and libwithsctp versioning, lets avoid +possible confusion and expand them instead of reusing the +PACKAGE_VERSION one. + +Fixes: #28 +Signed-off-by: Marcelo Ricardo Leitner +--- + Makefile.rules | 4 +++- + src/withsctp/withsctp.in | 2 +- + 2 files changed, 4 insertions(+), 2 deletions(-) + +diff --git a/Makefile.rules b/Makefile.rules +index d3693fa..9488228 100644 +--- a/Makefile.rules ++++ b/Makefile.rules +@@ -16,4 +16,6 @@ edit = @sed \ + -e "s|\@bindir\@|$(bindir)|" \ + -e "s|\@libdir\@|$(libdir)|" \ + -e "s|\@PACKAGE\@|$(PACKAGE)|" \ +- -e "s|\@PACKAGE_VERSION\@|$(PACKAGE_VERSION)|" ++ -e "s|\@LIBWITHSCTP_CURRENT\@|$(LIBWITHSCTP_CURRENT)|" \ ++ -e "s|\@LIBWITHSCTP_REVISION\@|$(LIBWITHSCTP_REVISION)|" \ ++ -e "s|\@LIBWITHSCTP_AGE\@|$(LIBWITHSCTP_AGE)|" +diff --git a/src/withsctp/withsctp.in b/src/withsctp/withsctp.in +index fda5ebc..ef4f7bb 100644 +--- a/src/withsctp/withsctp.in ++++ b/src/withsctp/withsctp.in +@@ -2,7 +2,7 @@ + # -*- sh -*- + LIBDIR=@libdir@/@PACKAGE@ + BINDIR=@bindir@ +-LIBVER=@PACKAGE_VERSION@ ++LIBVER=@LIBWITHSCTP_CURRENT@.@LIBWITHSCTP_AGE@.@LIBWITHSCTP_REVISION@ + export LD_PRELOAD=${LIBDIR}/libwithsctp.so.${LIBVER} + if ! ${BINDIR}/checksctp 2> /dev/null + then +-- +1.8.3.1 + diff --git a/bugfix-withsctp-use-PACKAGE-VERSION-in-withsctp.patch b/bugfix-withsctp-use-PACKAGE-VERSION-in-withsctp.patch new file mode 100644 index 0000000..d644e57 --- /dev/null +++ b/bugfix-withsctp-use-PACKAGE-VERSION-in-withsctp.patch @@ -0,0 +1,43 @@ +From 7c0ef4d441b3833e721df58f56e2cb8c81b34df4 Mon Sep 17 00:00:00 2001 +From: Xin Long +Date: Thu, 16 Aug 2018 14:12:01 +0800 +Subject: [PATCH 01/11] withsctp: use @PACKAGE_VERSION@ in withsctp.h + +use @PACKAGE_VERSION@ to replace the hardcode version. + +Signed-off-by: Xin Long +Acked-by: Neil Horman +Signed-off-by: Marcelo Ricardo Leitner +--- + Makefile.rules | 3 ++- + src/withsctp/withsctp.in | 3 ++- + 2 files changed, 4 insertions(+), 2 deletions(-) + +diff --git a/Makefile.rules b/Makefile.rules +index 83f5f0c..d3693fa 100644 +--- a/Makefile.rules ++++ b/Makefile.rules +@@ -15,4 +15,5 @@ + edit = @sed \ + -e "s|\@bindir\@|$(bindir)|" \ + -e "s|\@libdir\@|$(libdir)|" \ +- -e "s|\@PACKAGE\@|$(PACKAGE)|" ++ -e "s|\@PACKAGE\@|$(PACKAGE)|" \ ++ -e "s|\@PACKAGE_VERSION\@|$(PACKAGE_VERSION)|" +diff --git a/src/withsctp/withsctp.in b/src/withsctp/withsctp.in +index 7f182ba..fda5ebc 100644 +--- a/src/withsctp/withsctp.in ++++ b/src/withsctp/withsctp.in +@@ -2,7 +2,8 @@ + # -*- sh -*- + LIBDIR=@libdir@/@PACKAGE@ + BINDIR=@bindir@ +-export LD_PRELOAD=${LIBDIR}/libwithsctp.so.1.0.17 ++LIBVER=@PACKAGE_VERSION@ ++export LD_PRELOAD=${LIBDIR}/libwithsctp.so.${LIBVER} + if ! ${BINDIR}/checksctp 2> /dev/null + then + ${BINDIR}/checksctp; +-- +1.8.3.1 + diff --git a/lksctp-tools.spec b/lksctp-tools.spec index 05fbdb6..8344b1d 100644 --- a/lksctp-tools.spec +++ b/lksctp-tools.spec @@ -1,97 +1,98 @@ -Summary: User-space access to Linux Kernel SCTP -Name: lksctp-tools -Version: 1.0.18 -Release: 1%{?dist} -# src/apps/bindx_test.C is GPLv2, I've asked upstream for clarification -License: GPLv2 and GPLv2+ and LGPLv2 and MIT -Group: System Environment/Libraries -URL: http://lksctp.sourceforge.net -Source0: http://downloads.sourceforge.net/lksctp/%{name}-%{version}.tar.gz -Patch0: bugfix-withsctp-and-configure.patch -Patch1: bugfix-build-issue.patch -Patch2: bugfix-automake-errno-tests.patch -BuildRequires: libtool, automake, autoconf +Name: lksctp-tools +Version: 1.0.18 +Release: 1 +Summary: Linux Kernel Stream Control Transmission Protocol Tools + +License: GPLv2 and GPLv2+ and LGPLv2 and MIT +URL: http://lksctp.sourceforge.net +Source0: https://downloads.sourceforge.net/project/lksctp/lksctp-tools/%{name}-%{version}.tar.gz +Patch0: bugfix-withsctp-use-PACKAGE-VERSION-in-withsctp.patch +Patch1: bugfix-configure-add-CURRENT-REVISION-and-AGE-for-libsctp.patch +Patch2: bugfix-build-fix-netinet-sctp-not-to-be-installed.patch +Patch3: bugfix-build-remove-secondary-defines-in-favor-of-HAVE.patch +Patch4: bugfix-build-fix-probing-for-HAVE-SCTP-SENDV.patch +Patch5: bugfix-build-0b0dce7a36fb-actually-belongs-to-v4-19.patch +Patch6: bugfix-func-tests-fix-use-of-unitialized-var.patch +Patch7: bugfix-Fix-error-errno-typos.patch +Patch8: bugfix-withsctp-to-not-reuse-PACKAGE-VERSION-as-lib-version.patch +Patch9: bugfix-sctp-recvmsg-man-update.patch +Patch10: bugfix-automake-fix-include-dir-for-the-now-autogenerated-h.patch + +BuildRequires: make gcc libtool autoconf automake + %description -This is the lksctp-tools package for Linux Kernel SCTP (Stream Control -Transmission Protocol) Reference Implementation. +The lksctp-tools project provides a Linux user space library for SCTP (libsctp) +including C language header files (netinet/sctp.h) for accessing SCTP specific +application programming interfaces not provided by the standard sockets, +and also some helper utilities around SCTP. -This package is intended to supplement the Linux Kernel SCTP Reference -Implementation now available in the Linux kernel source tree in -versions 2.5.36 and following. For more information on LKSCTP see the -package documentation README file, section titled "LKSCTP - Linux -Kernel SCTP." +For more information on the features and functions currently supported by +lksctp, please refer to the documentation in the Linux kernel resp. in the +lksctp-tools package. The lksctp-tools source contains a set of test programs +which would also serve as example applications. -This package contains the base run-time library and command-line tools. -%package devel -Summary: Development files for lksctp-tools -Group: Development/Libraries -Requires: %{name} = %{version}-%{release} +%package devel +Summary: Development files for %{name} +Requires: %{name} = %{version}-%{release} + %description devel -Development files for lksctp-tools which include man pages, header files, -static libraries, symlinks to dynamic libraries and some tutorial source code. +Development files for %{name} which include header files and dynamic +libraries. -%package doc -Summary: Documents pertaining to SCTP -Group: System Environment/Libraries -Requires: %{name} = %{version}-%{release} -%description doc -Documents pertaining to LKSCTP & SCTP in general (IETF RFC's & Internet -Drafts). +%package_help + %prep -%setup -q -%patch0 -p1 -%patch1 -p1 -%patch2 -p1 +%autosetup -n %{name}-%{version} -p1 + %build -[ ! -x ./configure ] && sh bootstrap +rm -rf configure && sh bootstrap %configure --disable-static -# remove rpath from libtool -sed -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' libtool -sed -i 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' libtool +%disable_rpath +%make_build -make %{?_smp_mflags} %install -rm -f doc/rfc2960.txt doc/states.txt -make install DESTDIR="$RPM_BUILD_ROOT" INSTALL="install -p" +%make_install +%delete_la -find $RPM_BUILD_ROOT/%{_libdir}/ -name "*.la" | xargs rm -f +%pre +%preun %post -p /sbin/ldconfig - %postun -p /sbin/ldconfig -%files -%defattr(-,root,root,-) -%doc AUTHORS ChangeLog COPYING* README + +%files +%defattr(-,root,root) +%license COPYING* %{_bindir}/* %{_libdir}/libsctp.so.* -%dir %{_libdir}/lksctp-tools/ %{_libdir}/lksctp-tools/libwithsctp.so.* -%{_mandir}/man7/* + %files devel -%defattr(-,root,root,-) %{_includedir}/* %{_libdir}/libsctp.so %{_libdir}/lksctp-tools/libwithsctp.so -%{_libdir}/pkgconfig/libsctp.pc %{_datadir}/lksctp-tools/ -%{_mandir}/man3/* +%{_libdir}/pkgconfig/libsctp.pc + + +%files help +%doc AUTHORS ChangeLog README doc/*.txt +%{_mandir}/man3/* +%{_mandir}/man7/* -%files doc -%defattr(-,root,root,-) -%doc doc/*.txt %changelog -* Tue Jun 30 2020 hanhui - 1.0.18-1 -- openEuler Mainline Update to 1.0.18 - +* Wed Jul 15 2020 hanhui - 1.0.18-1 +- update to 1.0.18 + * Thu Nov 28 2019 Qianbiao.NG - 1.0.16-11 -- repackage for openEuler OS +- Repackage for openEuler OS