Fix: GTP/S1AP UE resource release leak issue.

This commit is contained in:
wanghe
2019-07-16 19:50:28 +09:00
committed by Haruki NAOI
parent 3492f60407
commit 1f211efb12
4 changed files with 89 additions and 9 deletions
+21 -3
View File
@@ -572,6 +572,10 @@ gtpv1u_create_s1u_tunnel(
int ip_offset = 0;
in_addr_t in_addr;
int addrs_length_in_bytes= 0;
int loop_counter = 0;
int ret = 0;
MSC_LOG_RX_MESSAGE(
MSC_GTPU_ENB,
MSC_RRC_ENB,
@@ -586,6 +590,7 @@ gtpv1u_create_s1u_tunnel(
for (i = 0; i < create_tunnel_req_pP->num_tunnels; i++) {
ip_offset = 0;
loop_counter = 0;
eps_bearer_id = create_tunnel_req_pP->eps_bearer_id[i];
LOG_D(GTPU, "Rx GTPV1U_ENB_CREATE_TUNNEL_REQ ue rnti %x eps bearer id %u\n",
create_tunnel_req_pP->rnti, eps_bearer_id);
@@ -600,7 +605,13 @@ gtpv1u_create_s1u_tunnel(
stack_req.apiInfo.createTunnelEndPointInfo.hStackSession = 0;
rc = nwGtpv1uProcessUlpReq(RC.gtpv1u_data_g->gtpv1u_stack, &stack_req);
LOG_D(GTPU, ".\n");
} while (rc != NW_GTPV1U_OK);
loop_counter++;
} while (rc != NW_GTPV1U_OK && loop_counter < 10);
if ( rc != NW_GTPV1U_OK && loop_counter == 10 ) {
LOG_E(GTPU,"NwGtpv1uCreateTunnelEndPoint failed 10 times,start next loop\n");
ret = -1;
continue;
}
//-----------------------
// PDCP->GTPV1U mapping
@@ -682,7 +693,8 @@ gtpv1u_create_s1u_tunnel(
LOG_D(GTPU, "Tx GTPV1U_ENB_CREATE_TUNNEL_RESP ue rnti %x status %d\n",
create_tunnel_req_pP->rnti,
create_tunnel_resp_pP->status);
return 0;
//return 0;
return ret;
}
int gtpv1u_update_s1u_tunnel(
@@ -713,9 +725,15 @@ int gtpv1u_update_s1u_tunnel(
memcpy(gtpv1u_ue_data_new_p,gtpv1u_ue_data_p,sizeof(gtpv1u_ue_data_t));
gtpv1u_ue_data_new_p->ue_id = create_tunnel_req_pP->rnti;
hash_rc = hashtable_insert(RC.gtpv1u_data_g->ue_mapping, create_tunnel_req_pP->rnti, gtpv1u_ue_data_new_p);
AssertFatal(hash_rc == HASH_TABLE_OK, "Error inserting ue_mapping in GTPV1U hashtable");
//AssertFatal(hash_rc == HASH_TABLE_OK, "Error inserting ue_mapping in GTPV1U hashtable");
if ( hash_rc != HASH_TABLE_OK ) {
LOG_E(GTPU,"Failed to insert ue_mapping(rnti=%x) in GTPV1U hashtable\n",create_tunnel_req_pP->rnti);
return -1;
} else {
LOG_I(GTPU, "inserting ue_mapping(rnti=%x) in GTPV1U hashtable\n",
create_tunnel_req_pP->rnti);
}
hash_rc = hashtable_remove(RC.gtpv1u_data_g->ue_mapping, prior_rnti);
LOG_I(GTPU, "hashtable_remove ue_mapping(rnti=%x) in GTPV1U hashtable\n",
prior_rnti);
+8 -3
View File
@@ -378,9 +378,14 @@ NwGtpv1uCreateTunnelEndPoint( NW_IN NwGtpv1uStackT *thiz,
*phStackSession = (NwGtpv1uStackSessionHandleT) pTunnelEndPoint;
pTunnelEndPoint = RB_FIND(NwGtpv1uTunnelEndPointIdentifierMap,
&(thiz->teidMap), pTunnelEndPoint);
NW_ASSERT(pTunnelEndPoint);
GTPU_DEBUG("Tunnel end-point 0x%p creation successful for teid 0x%x %u(dec)",
pTunnelEndPoint, (unsigned int)teid, (unsigned int)teid);
//NW_ASSERT(pTunnelEndPoint);
if (!pTunnelEndPoint) {
GTPU_ERROR("Tunnel end-point cannot be NULL");
rc = NW_GTPV1U_FAILURE;
} else {
GTPU_DEBUG("Tunnel end-point 0x%p creation successful for teid 0x%x %u(dec)",
pTunnelEndPoint, (unsigned int)teid, (unsigned int)teid);
}
}
} else {