x2ap/sctp: increase buffer size
The 5G phone OPPO has a very big UE capability (> 2KB).
We need bigger buffers to transfer this, especially in x2 handover.
Also the sctp messages need a bigger buffer.
Note: in sctp, we didn't check for partial messages, it's now
done. When detected, we exit. To be redone differently
if needed. (Look for "if (!(flags & MSG_EOR))".)
This commit is contained in:
@@ -205,7 +205,7 @@ typedef struct x2ap_handover_req_s {
|
||||
|
||||
x2ap_lastvisitedcell_info_t lastvisitedcell_info;
|
||||
|
||||
uint8_t rrc_buffer[1024 /* arbitrary, big enough */];
|
||||
uint8_t rrc_buffer[8192 /* arbitrary, big enough */];
|
||||
int rrc_buffer_size;
|
||||
|
||||
int target_assoc_id;
|
||||
|
||||
@@ -4614,10 +4614,10 @@ rrc_eNB_generate_HandoverPreparationInformation(
|
||||
uint8_t *buffer,
|
||||
int *_size
|
||||
) {
|
||||
memset(buffer, 0, RRC_BUF_SIZE);
|
||||
memset(buffer, 0, 8192);
|
||||
char *ho_buf = (char *) buffer;
|
||||
int ho_size;
|
||||
ho_size = do_HandoverPreparation(ho_buf, 1024, ue_context_pP->ue_context.UE_Capability, ue_context_pP->ue_context.UE_Capability_size);
|
||||
ho_size = do_HandoverPreparation(ho_buf, 8192, ue_context_pP->ue_context.UE_Capability, ue_context_pP->ue_context.UE_Capability_size);
|
||||
*_size = ho_size;
|
||||
}
|
||||
|
||||
|
||||
@@ -730,7 +730,7 @@ int x2ap_eNB_handle_handover_preparation (instance_t instance,
|
||||
|
||||
X2AP_RRC_Context_t *c = &ie->value.choice.UE_ContextInformation.rRC_Context;
|
||||
|
||||
if (c->size > 1024 /* TODO: this is the size of rrc_buffer in struct x2ap_handover_req_ack_s*/)
|
||||
if (c->size > 8192 /* TODO: this is the size of rrc_buffer in struct x2ap_handover_req_s */)
|
||||
{ printf("%s:%d: fatal: buffer too big\n", __FILE__, __LINE__); abort(); }
|
||||
|
||||
memcpy(X2AP_HANDOVER_REQ(msg).rrc_buffer, c->buf, c->size);
|
||||
@@ -821,7 +821,7 @@ int x2ap_eNB_handle_handover_response (instance_t instance,
|
||||
|
||||
X2AP_TargeteNBtoSource_eNBTransparentContainer_t *c = &ie->value.choice.TargeteNBtoSource_eNBTransparentContainer;
|
||||
|
||||
if (c->size > 1024 /* TODO: this is the size of rrc_buffer in struct x2ap_handover_req_ack_s*/)
|
||||
if (c->size > 1024 /* TODO: this is the size of rrc_buffer in struct x2ap_handover_req_ack_s */)
|
||||
{ printf("%s:%d: fatal: buffer too big\n", __FILE__, __LINE__); abort(); }
|
||||
|
||||
memcpy(X2AP_HANDOVER_REQ_ACK(msg).rrc_buffer, c->buf, c->size);
|
||||
|
||||
@@ -26,6 +26,6 @@
|
||||
#define SCTP_IN_STREAMS (16)
|
||||
#define SCTP_MAX_ATTEMPTS (2)
|
||||
#define SCTP_TIMEOUT (5)
|
||||
#define SCTP_RECV_BUFFER_SIZE (1024)
|
||||
#define SCTP_RECV_BUFFER_SIZE (8192)
|
||||
|
||||
#endif /* SCTP_DEFAULT_VALUES_H_ */
|
||||
|
||||
@@ -955,6 +955,11 @@ sctp_eNB_read_from_socket(
|
||||
return;
|
||||
}
|
||||
|
||||
if (!(flags & MSG_EOR)) {
|
||||
SCTP_ERROR("fatal: partial SCTP messages are not handled\n");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
if (flags & MSG_NOTIFICATION) {
|
||||
union sctp_notification *snp;
|
||||
snp = (union sctp_notification *)buffer;
|
||||
|
||||
Reference in New Issue
Block a user