lksctp-tools/bugfix-automake-errno-tests.patch
2020-07-02 15:14:59 +08:00

118 lines
4.8 KiB
Diff

From 356de6906c5b6d563f2d0568e86e3875ad482c66 Mon Sep 17 00:00:00 2001
From: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>
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 <jijianwen@gmail.com>
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 <marcelo.leitner@gmail.com>
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