From ec60cc9548a64fe83733f123eb70b96b5122c696 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Tue, 18 Mar 2025 17:29:51 +0100 Subject: [PATCH 1/2] SCTP: avoid assert on partial SCTP message The receive buffer for SCTP, as of this commit, is 8192. If a message is larger, we receive only a partial message, which makes the gNB abort. Remove the abort to not be susceptible to a message intended to crash the gNB. Closes: #920 --- openair3/SCTP/sctp_eNB_task.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/openair3/SCTP/sctp_eNB_task.c b/openair3/SCTP/sctp_eNB_task.c index 530b3ea6b0..6b83a7df6d 100644 --- a/openair3/SCTP/sctp_eNB_task.c +++ b/openair3/SCTP/sctp_eNB_task.c @@ -806,8 +806,8 @@ sctp_eNB_read_from_socket( } if (!(flags & MSG_EOR)) { - SCTP_ERROR("fatal: partial SCTP messages are not handled\n"); - exit_fun("fatal: partial SCTP messages are not handled" ); + SCTP_ERROR("partial SCTP message received, discarding message\n"); + return; } if (flags & MSG_NOTIFICATION) { From b138b143e4ef3784f5d5b882108b59db4df6dd4f Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Tue, 18 Mar 2025 17:32:34 +0100 Subject: [PATCH 2/2] Increase SCTP receive buffer to capture large messages --- openair3/SCTP/sctp_default_values.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openair3/SCTP/sctp_default_values.h b/openair3/SCTP/sctp_default_values.h index 0f8f94dca9..6049d143f8 100644 --- a/openair3/SCTP/sctp_default_values.h +++ b/openair3/SCTP/sctp_default_values.h @@ -26,6 +26,6 @@ #define SCTP_IN_STREAMS (16) #define SCTP_MAX_ATTEMPTS (8) #define SCTP_TIMEOUT (60000) -#define SCTP_RECV_BUFFER_SIZE (8192) +#define SCTP_RECV_BUFFER_SIZE (65536) #endif /* SCTP_DEFAULT_VALUES_H_ */