Correct how gtp-u extension header is parsed
This commit is contained in:
@@ -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){
|
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 );
|
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,
|
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 */
|
/* optional */
|
||||||
/* 6.3 measConfig */
|
/* 6.3 measConfig */
|
||||||
|
|||||||
@@ -758,10 +758,27 @@ static int Gtpv1uHandleGpdu(int h,
|
|||||||
return GTPNOK;
|
return GTPNOK;
|
||||||
}
|
}
|
||||||
|
|
||||||
int offset=8;
|
/*int offset=8;
|
||||||
|
|
||||||
if( msgHdr->E || msgHdr->S ||msgHdr->PN)
|
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
|
// This context is not good for gtp
|
||||||
// frame, ... has no meaning
|
// frame, ... has no meaning
|
||||||
|
|||||||
Reference in New Issue
Block a user