From 8102a5537f9648fb6fc5995052769982885e8b0b Mon Sep 17 00:00:00 2001 From: Lionel Gauthier Date: Mon, 2 Jun 2014 16:01:04 +0000 Subject: [PATCH] Retest, should add extra field in msg struct : extra_header_len git-svn-id: http://svn.eurecom.fr/openair4G/trunk@5365 818b1a75-f10b-46b9-bf7c-635c3b92a50f --- openair-cn/GTPV1-U/nw-gtpv1u/src/NwGtpv1u.c | 2 +- openair-cn/GTPV1-U/nw-gtpv1u/src/NwGtpv1uMsg.c | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/openair-cn/GTPV1-U/nw-gtpv1u/src/NwGtpv1u.c b/openair-cn/GTPV1-U/nw-gtpv1u/src/NwGtpv1u.c index 1a3bd8c872..b35339ce6d 100644 --- a/openair-cn/GTPV1-U/nw-gtpv1u/src/NwGtpv1u.c +++ b/openair-cn/GTPV1-U/nw-gtpv1u/src/NwGtpv1u.c @@ -220,7 +220,7 @@ nwGtpv1uCreateAndSendMsg( NwGtpv1uStackT *thiz, NwU32T peerIp, NwU16T peerPort, rc = thiz->udp.udpDataReqCallback(thiz->udp.hUdp, pMsg->msgBuf, - pMsg->msgLen, + pMsg->msgLen + NW_GTPV1U_EPC_MIN_HEADER_SIZE, peerIp, peerPort); diff --git a/openair-cn/GTPV1-U/nw-gtpv1u/src/NwGtpv1uMsg.c b/openair-cn/GTPV1-U/nw-gtpv1u/src/NwGtpv1uMsg.c index fc50c81601..cc7c723325 100644 --- a/openair-cn/GTPV1-U/nw-gtpv1u/src/NwGtpv1uMsg.c +++ b/openair-cn/GTPV1-U/nw-gtpv1u/src/NwGtpv1uMsg.c @@ -47,6 +47,7 @@ #include "UTIL/LOG/log.h" #define NW_GTPV1U_EPC_SPECIFIC_HEADER_SIZE (12) /**< Size of GTPv1u EPC specific header */ +#define NW_GTPV1U_EPC_MIN_HEADER_SIZE (8) #ifdef __cplusplus extern "C" { @@ -143,7 +144,9 @@ nwGtpv1uGpduMsgNew( NW_IN NwGtpv1uStackHandleT hGtpuStackHandle, memcpy(pMsg->msgBuf + pMsg->msgLen, tpdu, tpduLength); pMsg->msgLen += tpduLength; - pMsg->msgLen -= 8; + pMsg->msgLen = pMsg->msgLen - ((pMsg->seqNumFlag || pMsg->npduNumFlag + || pMsg->extHdrFlag ) ? + NW_GTPV1U_EPC_SPECIFIC_HEADER_SIZE : (NW_GTPV1U_EPC_SPECIFIC_HEADER_SIZE - 4)); *phMsg = (NwGtpv1uMsgHandleT) pMsg; return NW_GTPV1U_OK;