diff --git a/openair2/F1AP/f1ap_cu_ue_context_management.c b/openair2/F1AP/f1ap_cu_ue_context_management.c index 141d89ac51..037be0c8d4 100644 --- a/openair2/F1AP/f1ap_cu_ue_context_management.c +++ b/openair2/F1AP/f1ap_cu_ue_context_management.c @@ -144,7 +144,7 @@ int CU_send_UE_CONTEXT_SETUP_REQUEST(instance_t instance, if(f1ap_ue_context_setup_req->cu_to_du_rrc_information->uE_CapabilityRAT_ContainerList!=NULL){ asn1cCalloc(ie6->value.choice.CUtoDURRCInformation.uE_CapabilityRAT_ContainerList, uE_CapabilityRAT_ContainerList ); OCTET_STRING_fromBuf(uE_CapabilityRAT_ContainerList, (const char *)f1ap_ue_context_setup_req->cu_to_du_rrc_information->uE_CapabilityRAT_ContainerList, - f1ap_ue_context_setup_req->cu_to_du_rrc_information->uE_CapabilityRAT_ContainerList_length) ; + f1ap_ue_context_setup_req->cu_to_du_rrc_information->uE_CapabilityRAT_ContainerList_length); } /* optional */ /* 6.3 measConfig */ diff --git a/openair3/ocp-gtpu/gtp_itf.cpp b/openair3/ocp-gtpu/gtp_itf.cpp index 59aeb824fb..585a7d5a4b 100644 --- a/openair3/ocp-gtpu/gtp_itf.cpp +++ b/openair3/ocp-gtpu/gtp_itf.cpp @@ -758,10 +758,27 @@ static int Gtpv1uHandleGpdu(int h, return GTPNOK; } - int offset=8; + /*int offset=8; if( msgHdr->E || msgHdr->S ||msgHdr->PN) - offset+=8; + offset+=8;*/ + + +//Minimum length of GTP-U header if non of the optional fields are present + int offset= sizeof(Gtpv1uMsgHeaderT); + + //Consider additional length for GTP-U header if at least one of the optional fields is present + if( msgHdr->E || msgHdr->S ||msgHdr->PN) + offset+=4; + + //Consider the length of 1 or more extension headers that can be present in the GTP-U PDU + if(msgHdr->E) { + while (msgBuf[offset]!=0) { + LOG_D(GTPU, "Extension header length in multiple of 4 bytes is: %d \n", msgBuf[offset]); + offset+=msgBuf[offset]*4 -1; + } + offset++; + } // This context is not good for gtp // frame, ... has no meaning