[LTP] [PATCH] sctp: bugfix for utils/sctp/func_tests/test_1_to_1_events.c

yangfeng yangfeng59949@163.com
Fri Mar 29 16:47:15 CET 2024


From: yangfeng <yangfeng@kylinos.cn>

event not initialized to 0 causes "Got a notification,
expecting a datamsg" issues

Signed-off-by: yangfeng <yangfeng@kylinos.cn>
---
 utils/sctp/func_tests/test_1_to_1_events.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/utils/sctp/func_tests/test_1_to_1_events.c b/utils/sctp/func_tests/test_1_to_1_events.c
index 447845ff3..889d2ff33 100644
--- a/utils/sctp/func_tests/test_1_to_1_events.c
+++ b/utils/sctp/func_tests/test_1_to_1_events.c
@@ -96,6 +96,7 @@ main(void)
 	/* Create the client socket.  */
 	clt_sk = test_socket(AF_INET, SOCK_STREAM, IPPROTO_SCTP);

+	memset(&event, 0, sizeof(struct sctp_event_subscribe));
 	event.sctp_data_io_event = 1;
 	event.sctp_association_event = 1;
 	event.sctp_shutdown_event = 1;
--
2.25.1



More information about the ltp mailing list