Commit 2d445364 authored by Raymond Knopp's avatar Raymond Knopp

Correct how gtp-u extension header is parsed

parent 12792eec
......@@ -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 */
......
......@@ -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
......
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