Merge branch 'bugfix-183-LOG_X-format' into develop_integration_w02

This commit is contained in:
Cedric Roux
2017-01-13 17:16:16 +01:00
53 changed files with 306 additions and 245 deletions
+2 -2
View File
@@ -410,7 +410,7 @@ nwGtpv1uDestroyTunnelEndPoint( NwGtpv1uStackT *thiz,
NwGtpv1uTunnelEndPointT *pRemovedTeid;
if(pUlpReq->apiInfo.destroyTunnelEndPointInfo.hStackSessionHandle) {
GTPU_DEBUG( "Destroying Tunnel end-point '%x'",
GTPU_DEBUG( "Destroying Tunnel end-point '%lx'",
pUlpReq->apiInfo.destroyTunnelEndPointInfo.hStackSessionHandle);
pRemovedTeid = RB_REMOVE(NwGtpv1uTunnelEndPointIdentifierMap, &(thiz->teidMap),
(NwGtpv1uTunnelEndPointT *)(
@@ -423,7 +423,7 @@ nwGtpv1uDestroyTunnelEndPoint( NwGtpv1uStackT *thiz,
(NwGtpv1uTunnelEndPointT *)
pUlpReq->apiInfo.destroyTunnelEndPointInfo.hStackSessionHandle);
} else {
GTPU_WARNING("Non-existent Tunnel end-point handle '%x'",
GTPU_WARNING("Non-existent Tunnel end-point handle '%lx'",
pUlpReq->apiInfo.destroyTunnelEndPointInfo.hStackSessionHandle);
}
@@ -523,7 +523,7 @@ int nas_message_encode(
/* Compute the NAS message authentication code */
LOG_TRACE(DEBUG,
"offset %d = %d - %d, hdr encode = %d, length = %d bytes = %d",
offset, size, sizeof(uint8_t),
offset, size, (int)sizeof(uint8_t),
size, length, bytes);
uint32_t mac = _nas_message_get_mac(
buffer + offset,
@@ -1296,7 +1296,9 @@ static uint32_t _nas_message_get_mac(
uint32_t count;
uint32_t *mac32;
#ifdef DEBUG_NAS_MESSAGE
int i,bytes = 0;
#endif
if (direction == SECU_DIRECTION_UPLINK) {
count = 0x00000000 |
+2 -2
View File
@@ -131,7 +131,7 @@ do {
do { \
nas_log_func_indent -= 2; \
LOG_D(NAS, " %s:%d %*sLeaving %s(rc = %ld)\n", __FILE__, __LINE__, nas_log_func_indent, "", \
__FUNCTION__, (long) rETURNcODE); \
__FUNCTION__, (long) (rETURNcODE)); \
return (rETURNcODE); \
} while (0)
@@ -146,7 +146,7 @@ extern int nas_log_func_indent;
# define LOG_FUNC_RETURN(rETURNcODE) \
do { \
LOG_TRACE(FUNC_OUT, "Leaving %s(rc = %ld)", __FUNCTION__, \
(long) rETURNcODE); \
(long) (rETURNcODE)); \
return (rETURNcODE); \
} while(0)
+6 -5
View File
@@ -807,8 +807,7 @@ int emm_proc_plmn_selection_end(int found, tac_t tac, ci_t ci, AcT_t rat)
if (is_forbidden) {
/* The selected cell is known not to be able to provide normal
* service */
LOG_TRACE(INFO, "EMM-IDLE - UE may camp on this acceptable cell ",
"for limited services");
LOG_TRACE(INFO, "EMM-IDLE - UE may camp on this acceptable cell for limited services");
/* Save the index of the first forbidden PLMN */
if (_emm_plmn_list.fplmn < 0) {
@@ -819,8 +818,7 @@ int emm_proc_plmn_selection_end(int found, tac_t tac, ci_t ci, AcT_t rat)
} else {
/* A suitable cell has been found and the PLMN or tracking area
* is not in the forbidden list */
LOG_TRACE(INFO, "EMM-IDLE - UE may camp on this suitable cell ",
"for normal services");
LOG_TRACE(INFO, "EMM-IDLE - UE may camp on this suitable cell for normal services");
_emm_plmn_list.fplmn = -1;
_emm_plmn_list.param[index].stat = NET_OPER_CURRENT;
emm_sap.primitive = EMMREG_REGISTER_CNF;
@@ -905,7 +903,10 @@ int emm_proc_plmn_selection_end(int found, tac_t tac, ci_t ci, AcT_t rat)
* Or terminate the PLMN selection procedure
*/
if (!select_next_plmn) {
if (!(_emm_plmn_list.fplmn) < 0) { // FIXME this comparison makes no sense (bool < 0)
/* TODO: be sure of this fix */
LOG_TRACE(WARNING, "%s:%d:%s: be sure!!\n", __FILE__, __LINE__, __FUNCTION__);
//if (!(_emm_plmn_list.fplmn) < 0) { // FIXME this comparison makes no sense (bool < 0)
if (!(_emm_plmn_list.fplmn < 0)) { // FIXME this comparison makes no sense (bool < 0)
/* There were one or more PLMNs which were available and allowable,
* but an LR failure made registration on those PLMNs unsuccessful
* or an entry in any of the forbidden area lists prevented a
+8 -8
View File
@@ -205,7 +205,7 @@ int s1ap_eNB_handle_message(uint32_t assoc_id, int32_t stream,
if (message.procedureCode > sizeof(messages_callback) / (3 * sizeof(
s1ap_message_decoded_callback))
|| (message.direction > S1AP_PDU_PR_unsuccessfulOutcome)) {
S1AP_ERROR("[SCTP %d] Either procedureCode %d or direction %d exceed expected\n",
S1AP_ERROR("[SCTP %d] Either procedureCode %ld or direction %d exceed expected\n",
assoc_id, message.procedureCode, message.direction);
return -1;
}
@@ -214,7 +214,7 @@ int s1ap_eNB_handle_message(uint32_t assoc_id, int32_t stream,
* This can mean not implemented or no procedure for eNB (wrong direction).
*/
if (messages_callback[message.procedureCode][message.direction-1] == NULL) {
S1AP_ERROR("[SCTP %d] No handler for procedureCode %d in %s\n",
S1AP_ERROR("[SCTP %d] No handler for procedureCode %ld in %s\n",
assoc_id, message.procedureCode,
s1ap_direction2String[message.direction]);
return -1;
@@ -452,10 +452,10 @@ int s1ap_eNB_handle_error_indication(uint32_t assoc_id,
return -1;
}
if ( s1_error_indication_p->presenceMask & S1AP_ERRORINDICATIONIES_MME_UE_S1AP_ID_PRESENT) {
S1AP_WARN("Received S1 Error indication MME UE S1AP ID 0x%x\n", s1_error_indication_p->mme_ue_s1ap_id);
S1AP_WARN("Received S1 Error indication MME UE S1AP ID 0x%lx\n", s1_error_indication_p->mme_ue_s1ap_id);
}
if ( s1_error_indication_p->presenceMask & S1AP_ERRORINDICATIONIES_ENB_UE_S1AP_ID_PRESENT) {
S1AP_WARN("Received S1 Error indication eNB UE S1AP ID 0x%x\n", s1_error_indication_p->eNB_UE_S1AP_ID);
S1AP_WARN("Received S1 Error indication eNB UE S1AP ID 0x%lx\n", s1_error_indication_p->eNB_UE_S1AP_ID);
}
if ( s1_error_indication_p->presenceMask & S1AP_ERRORINDICATIONIES_CAUSE_PRESENT) {
@@ -710,7 +710,7 @@ int s1ap_eNB_handle_initial_context_request(uint32_t assoc_id,
if ((ue_desc_p = s1ap_eNB_get_ue_context(mme_desc_p->s1ap_eNB_instance,
initialContextSetupRequest_p->eNB_UE_S1AP_ID)) == NULL) {
S1AP_ERROR("[SCTP %d] Received initial context setup request for non "
"existing UE context 0x%06x\n", assoc_id,
"existing UE context 0x%06lx\n", assoc_id,
initialContextSetupRequest_p->eNB_UE_S1AP_ID);
return -1;
}
@@ -835,7 +835,7 @@ int s1ap_eNB_handle_ue_context_release_command(uint32_t assoc_id,
if ((ue_desc_p = s1ap_eNB_get_ue_context(mme_desc_p->s1ap_eNB_instance,
enb_ue_s1ap_id)) == NULL) {
S1AP_ERROR("[SCTP %d] Received UE context release command for non "
"existing UE context 0x%06x\n",
"existing UE context 0x%06lx\n",
assoc_id,
enb_ue_s1ap_id);
/*MessageDef *msg_complete_p;
@@ -900,7 +900,7 @@ int s1ap_eNB_handle_e_rab_setup_request(uint32_t assoc_id,
if ((ue_desc_p = s1ap_eNB_get_ue_context(mme_desc_p->s1ap_eNB_instance,
s1ap_E_RABSetupRequest->eNB_UE_S1AP_ID)) == NULL) {
S1AP_ERROR("[SCTP %d] Received initial context setup request for non "
"existing UE context 0x%06x\n", assoc_id,
"existing UE context 0x%06lx\n", assoc_id,
s1ap_E_RABSetupRequest->eNB_UE_S1AP_ID);
return -1;
}
@@ -915,7 +915,7 @@ int s1ap_eNB_handle_e_rab_setup_request(uint32_t assoc_id,
ue_desc_p->rx_stream = stream;
if ( ue_desc_p->mme_ue_s1ap_id != s1ap_E_RABSetupRequest->mme_ue_s1ap_id){
S1AP_WARN("UE context mme_ue_s1ap_id is different form that of the message (%d != %d)",
S1AP_WARN("UE context mme_ue_s1ap_id is different form that of the message (%d != %ld)",
ue_desc_p->mme_ue_s1ap_id, s1ap_E_RABSetupRequest->mme_ue_s1ap_id);
}
+8 -4
View File
@@ -288,9 +288,13 @@ int s1ap_eNB_handle_nas_downlink(const uint32_t assoc_id,
downlink_NAS_transport_p->eNB_UE_S1AP_ID,
downlink_NAS_transport_p->mme_ue_s1ap_id);
S1AP_ERROR("[SCTP %d] Received NAS downlink message for non existing UE context eNB_UE_S1AP_ID: 0x%"PRIx32" %u\n",
/* TODO: fix this log - the original version is suspicious (twice downlink_NAS_transport_p->eNB_UE_S1AP_ID?) */
/*S1AP_ERROR("[SCTP %d] Received NAS downlink message for non existing UE context eNB_UE_S1AP_ID: 0x%"PRIx32" %u\n",
assoc_id,
downlink_NAS_transport_p->eNB_UE_S1AP_ID,
downlink_NAS_transport_p->eNB_UE_S1AP_ID);*/
S1AP_ERROR("[SCTP %d] Received NAS downlink message for non existing UE context eNB_UE_S1AP_ID: 0x%lx\n",
assoc_id,
downlink_NAS_transport_p->eNB_UE_S1AP_ID);
return -1;
}
@@ -311,7 +315,7 @@ int s1ap_eNB_handle_nas_downlink(const uint32_t assoc_id,
} else {
/* We already have a mme ue s1ap id check the received is the same */
if (ue_desc_p->mme_ue_s1ap_id != downlink_NAS_transport_p->mme_ue_s1ap_id) {
S1AP_ERROR("[SCTP %d] Mismatch in MME UE S1AP ID (0x%"PRIx32" != 0x%"PRIx32")\n",
S1AP_ERROR("[SCTP %d] Mismatch in MME UE S1AP ID (0x%lx != 0x%"PRIx32"\n",
assoc_id,
downlink_NAS_transport_p->mme_ue_s1ap_id,
ue_desc_p->mme_ue_s1ap_id
@@ -579,7 +583,7 @@ int s1ap_eNB_initial_ctxt_resp(
new_item->transportLayerAddress.size = initial_ctxt_resp_p->e_rabs[i].eNB_addr.length;
new_item->transportLayerAddress.bits_unused = 0;
S1AP_DEBUG("initial_ctxt_resp_p: e_rab ID %d, enb_addr %d.%d.%d.%d, SIZE %d \n",
S1AP_DEBUG("initial_ctxt_resp_p: e_rab ID %ld, enb_addr %d.%d.%d.%d, SIZE %d \n",
new_item->e_RAB_ID,
new_item->transportLayerAddress.buf[0],
new_item->transportLayerAddress.buf[1],
@@ -778,7 +782,7 @@ int s1ap_eNB_e_rab_setup_resp(instance_t instance,
new_item->transportLayerAddress.size = e_rab_setup_resp_p->e_rabs[i].eNB_addr.length;
new_item->transportLayerAddress.bits_unused = 0;
S1AP_DEBUG("e_rab_setup_resp: e_rab ID %d, teid %u, enb_addr %d.%d.%d.%d, SIZE %d\n",
S1AP_DEBUG("e_rab_setup_resp: e_rab ID %ld, teid %u, enb_addr %d.%d.%d.%d, SIZE %d\n",
new_item->e_RAB_ID,
e_rab_setup_resp_p->e_rabs[i].gtp_teid,
new_item->transportLayerAddress.buf[0],
+1 -1
View File
@@ -379,7 +379,7 @@ void *udp_eNB_task(void *args_p)
sizeof(struct sockaddr_in));
if (bytes_written != udp_data_req_p->buffer_length) {
LOG_E(UDP_, "There was an error while writing to socket %u rc %d"
LOG_E(UDP_, "There was an error while writing to socket %d rc %zd"
"(%d:%s) May be normal if GTPU kernel module loaded on same host (may NF_DROP IP packet)\n",
udp_sd, bytes_written, errno, strerror(errno));
}