Skip to contentSkip to conversation

sctp: bugfix for utils/sctp/func_tests/test_1_to_1_events.c

PATCH In review yangfeng 2 participants 4 messages Apr 2, 2024 – Apr 5, 2024

lore
Share & tools
lore

yangfeng

author
#0 lore raw

PATCH 1/1 sctp: bugfix for utils/sctp/func_tests/test_1_to_1_events.c

From: yangfeng <[email protected]>

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

---
 utils/sctp/func_tests/test_1_to_1_events.c | 1 +
 1 file changed, 1 insertion(+)
utils/sctp/func_tests/test_1_to_1_events.c +1 -0
index 447845ff3..889d2ff33 100644
@@ -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

Signature · 1 line
Mailing list info: https://lists.linux.it/listinfo/ltp
Reviewed-by on v1 1/1
#1 lore raw

Hi,

Quoted 2 lines

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

Out of curiosity which architecture, kernel version, toolchain version and distro do you see the issue? I cannot reproduce it on any of systems we test.

...

utils/sctp/func_tests/test_1_to_1_events.c main(void) · line 99

Quoted 6 lines

+++ b/utils/sctp/func_tests/test_1_to_1_events.c

utils/sctp/func_tests/test_1_to_1_events.c +1 -0
@@ -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));

Obviously correct.

Note, nowadays it'd be enough to initialize as:

struct sctp_event_subscribe event = {0};

But because we use the old style with the rest of the functions, memset() is OK.

Kind regards,
Petr

Signature · 1 line
Mailing list info: https://lists.linux.it/listinfo/ltp
#2 lore raw

Hi,<br/>Thanks for getting back to me.<br/><br/>gcc (GCC) 7.3.0<br/>Linux localhost.localdomain 4.19.90-89.6.v2401.ky10.aarch64 #1 SMP Thu Mar 14 20:06:10 CST 2024 aarch64 aarch64 aarch64 GNU/Linux<br/>Manufacturers ID: HiSilicon<br/>BIOS Vendor ID: QEMU<br/>Model name: Kunpeng-920<br/>BIOS Model name: virt-4.1<br/><br/>Kind regards,<br/>yangfeng

Quoted 28 lines · Petr Vorel

Hi,

Quoted 2 lines

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

Out of curiosity which architecture, kernel version, toolchain version and distro do you see the issue? I cannot reproduce it on any of systems we test.

...

utils/sctp/func_tests/test_1_to_1_events.c main(void) · line 99

Quoted 6 lines

+++ b/utils/sctp/func_tests/test_1_to_1_events.c

utils/sctp/func_tests/test_1_to_1_events.c +1 -0
@@ -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));

Obviously correct.

Note, nowadays it'd be enough to initialize as:

struct sctp_event_subscribe event = {0};

But because we use the old style with the rest of the functions, memset() is OK.

Kind regards,
Petr

Signature · 1 line
Mailing list info: https://lists.linux.it/listinfo/ltp
#3 lore raw

Hi,

Quoted 1 line

Hi,<br/>Thanks for getting back to me.<br/><br/>gcc (GCC) 7.3.0<br/>Linux localhost.localdomain 4.19.90-89.6.v2401.ky10.aarch64 #1 SMP Thu Mar 14 20:06:10 CST 2024 aarch64 aarch64 aarch64 GNU/Linux<br/>Manufacturers ID: HiSilicon<br/>BIOS Vendor ID: QEMU<br/>Model name: Kunpeng-920<br/>BIOS Model name: virt-4.1<br/><br/>Kind regards,<br/>yangfeng

Thanks for info, merged.

Kind regards,
Petr

Signature · 1 line
Mailing list info: https://lists.linux.it/listinfo/ltp