Fix bug: correctly fill LCID in ue context setup resp
Before this bug fix, when using F1, we get this warning: Constraint validation failed: LCID: constraint failed (/home/richie/openairinterface5g/cmake_targets/ran_build/build/openair2/F1AP/MESSAGES/F1AP_LCID.c:30) This is because (1) we don't actually store the LCID, then (2) we did not put it into the F1 ASN.1 structures. Fix both, to make this warning disappear. To actually print the full error message, increase the error buffer size. Also, for the future, to avoid guessing, print ASN.1 XML when we encounter a failed constraint validation.
This commit is contained in:
@@ -593,6 +593,7 @@ int DU_send_UE_CONTEXT_SETUP_RESPONSE(sctp_assoc_t assoc_id, f1ap_ue_context_set
|
||||
F1AP_SRBs_Setup_Item_t *srbs_setup_item=&srbs_setup_item_ies->value.choice.SRBs_Setup_Item;
|
||||
/* sRBID */
|
||||
srbs_setup_item->sRBID = resp->srbs_to_be_setup[i].srb_id;
|
||||
srbs_setup_item->lCID = resp->srbs_to_be_setup[i].lcid;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -40,13 +40,13 @@ int f1ap_encode_pdu(F1AP_F1AP_PDU_t *pdu, uint8_t **buffer, uint32_t *length) {
|
||||
LOG_E(F1AP, "----------------- ASN1 ENCODER PRINT END----------------- \n");
|
||||
}
|
||||
|
||||
char errbuf[128]; /* Buffer for error message */
|
||||
char errbuf[4096]; /* Buffer for error message */
|
||||
size_t errlen = sizeof(errbuf); /* Size of the buffer */
|
||||
int ret = asn_check_constraints(&asn_DEF_F1AP_F1AP_PDU, pdu, errbuf, &errlen);
|
||||
|
||||
/* assert(errlen < sizeof(errbuf)); // Guaranteed: you may rely on that */
|
||||
if(ret) {
|
||||
fprintf(stderr, "Constraint validation failed: %s\n", errbuf);
|
||||
xer_fprint(stdout, &asn_DEF_F1AP_F1AP_PDU, pdu);
|
||||
LOG_E(F1AP, "Constraint validation failed: %s\n", errbuf);
|
||||
}
|
||||
|
||||
encoded = aper_encode_to_new_buffer(&asn_DEF_F1AP_F1AP_PDU, 0, pdu, (void **)buffer);
|
||||
|
||||
@@ -233,7 +233,8 @@ static int handle_ue_context_srbs_setup(NR_UE_info_t *UE,
|
||||
nr_lc_config_t c = {.lcid = rlc_BearerConfig->logicalChannelIdentity, .priority = priority};
|
||||
nr_mac_add_lcid(&UE->UE_sched_ctrl, &c);
|
||||
|
||||
(*resp_srbs)[i] = *srb;
|
||||
(*resp_srbs)[i].srb_id = srb->srb_id;
|
||||
(*resp_srbs)[i].lcid = c.lcid;
|
||||
|
||||
int ret = ASN_SEQUENCE_ADD(&cellGroupConfig->rlc_BearerToAddModList->list, rlc_BearerConfig);
|
||||
DevAssert(ret == 0);
|
||||
|
||||
Reference in New Issue
Block a user