Commit a1d80515 authored by laurent's avatar laurent

add a bug fix to takcly usefully CI run

parent 1e8719c1
This diff is collapsed.
...@@ -286,7 +286,7 @@ static void SendFrame(guint8 radioType, guint8 direction, guint8 rntiType, ...@@ -286,7 +286,7 @@ static void SendFrame(guint8 radioType, guint8 direction, guint8 rntiType,
guint8 isPredefinedData, guint8 retx, guint8 crcStatus, guint8 isPredefinedData, guint8 retx, guint8 crcStatus,
guint8 oob_event, guint8 oob_event_value, guint8 oob_event, guint8 oob_event_value,
uint8_t *pdu_buffer, unsigned int pdu_buffer_size) { uint8_t *pdu_buffer, unsigned int pdu_buffer_size) {
unsigned char frameBuffer[9000]; unsigned char frameBuffer[16000];
unsigned int frameOffset; unsigned int frameOffset;
ssize_t bytesSent; ssize_t bytesSent;
frameOffset = 0; frameOffset = 0;
...@@ -385,8 +385,11 @@ static void SendFrame(guint8 radioType, guint8 direction, guint8 rntiType, ...@@ -385,8 +385,11 @@ static void SendFrame(guint8 radioType, guint8 direction, guint8 rntiType,
//memcpy(frameBuffer+frameOffset, g_PDUBuffer, g_PDUOffset); //memcpy(frameBuffer+frameOffset, g_PDUBuffer, g_PDUOffset);
//frameOffset += g_PDUOffset; //frameOffset += g_PDUOffset;
if (pdu_buffer != NULL) { if (pdu_buffer != NULL) {
memcpy(frameBuffer+frameOffset, (void *)pdu_buffer, pdu_buffer_size); const int sz = min(pdu_buffer_size, sizeof(frameBuffer)-frameOffset);
frameOffset += pdu_buffer_size; memcpy(frameBuffer+frameOffset, (void *)pdu_buffer, sz);
if ( pdu_buffer_size != sz )
LOG_W(OPT,"pdu is huge : %d\n", pdu_buffer_size);
frameOffset += sz;
} }
if ( opt_type == OPT_WIRESHARK ) if ( opt_type == OPT_WIRESHARK )
...@@ -408,7 +411,7 @@ static void SendFrameNR(guint8 radioType, guint8 direction, guint8 rntiType, ...@@ -408,7 +411,7 @@ static void SendFrameNR(guint8 radioType, guint8 direction, guint8 rntiType,
guint8 isPredefinedData, guint8 retx, guint8 crcStatus, guint8 isPredefinedData, guint8 retx, guint8 crcStatus,
guint8 oob_event, guint8 oob_event_value, guint8 oob_event, guint8 oob_event_value,
uint8_t *pdu_buffer, unsigned int pdu_buffer_size) { uint8_t *pdu_buffer, unsigned int pdu_buffer_size) {
unsigned char frameBuffer[12000]; unsigned char frameBuffer[32000];
unsigned int frameOffset; unsigned int frameOffset;
ssize_t bytesSent; ssize_t bytesSent;
frameOffset = 0; frameOffset = 0;
...@@ -454,8 +457,11 @@ static void SendFrameNR(guint8 radioType, guint8 direction, guint8 rntiType, ...@@ -454,8 +457,11 @@ static void SendFrameNR(guint8 radioType, guint8 direction, guint8 rntiType,
//memcpy(frameBuffer+frameOffset, g_PDUBuffer, g_PDUOffset); //memcpy(frameBuffer+frameOffset, g_PDUBuffer, g_PDUOffset);
//frameOffset += g_PDUOffset; //frameOffset += g_PDUOffset;
if (pdu_buffer != NULL) { if (pdu_buffer != NULL) {
memcpy(frameBuffer+frameOffset, (void *)pdu_buffer, pdu_buffer_size); const int sz=min(pdu_buffer_size, sizeof(frameBuffer)-frameOffset);
frameOffset += pdu_buffer_size; memcpy(frameBuffer+frameOffset, (void *)pdu_buffer, sz);
if ( sz != pdu_buffer_size )
LOG_W(OPT,"large pdu: %d\n", pdu_buffer_size);
frameOffset += sz;
} }
if ( opt_type == OPT_WIRESHARK ) if ( opt_type == OPT_WIRESHARK )
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment