Protect some xer_fprints by an if

This commit is contained in:
rmagueta
2021-07-14 15:30:07 +01:00
parent 7758e8acfc
commit a2450bb4b7
7 changed files with 24 additions and 16 deletions
+3 -1
View File
@@ -2188,7 +2188,7 @@ uint16_t nr_generate_ulsch_pdu(uint8_t *sdus_payload,
((NR_MAC_SUBHEADER_SHORT *) mac_pdu_ptr)->F = 0;
((NR_MAC_SUBHEADER_SHORT *) mac_pdu_ptr)->LCID = sdu_lcids[i];
((NR_MAC_SUBHEADER_SHORT *) mac_pdu_ptr)->L = (unsigned char) sdu_lengths[i];
mac_pdu_ptr += sizeof(NR_MAC_SUBHEADER_SHORT);
mac_pdu_ptr += sizeof(NR_MAC_SUBHEADER_SHORT);
} else {
((NR_MAC_SUBHEADER_LONG *) mac_pdu_ptr)->R = 0;
((NR_MAC_SUBHEADER_LONG *) mac_pdu_ptr)->F = 1;
@@ -2276,7 +2276,9 @@ uint16_t nr_generate_ulsch_pdu(uint8_t *sdus_payload,
if(buflen > 0) // If the buflen is provided
padding_bytes = buflen + pdu - (unsigned char *) mac_pdu_ptr;
AssertFatal(padding_bytes>=0,"");
// Compute final offset for padding
if (post_padding || padding_bytes>0) {
((NR_MAC_SUBHEADER_FIXED *) mac_pdu_ptr)->R = 0;
+1 -1
View File
@@ -66,7 +66,7 @@ static void nr_pdcp_entity_recv_pdu(nr_pdcp_entity_t *entity,
}
/* SRBs always have MAC-I, even if integrity is not active */
if ( entity->has_integrity || entity->type == NR_PDCP_SRB) {
if (entity->has_integrity || entity->type == NR_PDCP_SRB) {
integrity_size = 4;
} else {
integrity_size = 0;
+1
View File
@@ -47,6 +47,7 @@ extern RAN_CONTEXT_t RC;
#include <stdint.h>
#include <executables/softmodem-common.h>
static nr_rlc_ue_manager_t *nr_rlc_ue_manager;
/* TODO: handle time a bit more properly */
+6 -4
View File
@@ -1257,7 +1257,10 @@ nr_rrc_ue_process_masterCellGroup(
(void **)&cellGroupConfig,
(uint8_t *)masterCellGroup->buf,
masterCellGroup->size, 0, 0);
xer_fprint(stdout, &asn_DEF_NR_CellGroupConfig, (const void*)cellGroupConfig);
if ( LOG_DEBUGFLAG(DEBUG_ASN1) ) {
xer_fprint(stdout, &asn_DEF_NR_CellGroupConfig, (const void *) cellGroupConfig);
}
if( cellGroupConfig->spCellConfig != NULL && cellGroupConfig->spCellConfig->reconfigurationWithSync != NULL){
//TODO (perform Reconfiguration with sync according to 5.3.5.5.2)
@@ -2200,7 +2203,6 @@ nr_rrc_ue_establish_srb2(
ie->nonCriticalExtension->masterCellGroup);
}
if (ie->radioBearerConfig != NULL) {
LOG_I(NR_RRC, "radio Bearer Configuration is present\n");
nr_sa_rrc_ue_process_radioBearerConfig(ctxt_pP, gNB_index, ie->radioBearerConfig);
@@ -2304,9 +2306,9 @@ nr_rrc_ue_establish_srb2(
return -1;
}
// if ( LOG_DEBUGFLAG(DEBUG_ASN1) ) {
if ( LOG_DEBUGFLAG(DEBUG_ASN1) ) {
xer_fprint(stdout, &asn_DEF_NR_DL_DCCH_Message,(void *)dl_dcch_msg);
// }
}
if (dl_dcch_msg->message.present == NR_DL_DCCH_MessageType_PR_c1) {
switch (dl_dcch_msg->message.choice.c1->present) {