Commit 6da41d24 authored by thomasl's avatar thomasl
Browse files

some warnings in gtpv1u and one bug in itti: task killer was sending signal USR1 to wrong threads


git-svn-id: http://svn.eurecom.fr/openair4G/trunk@6670 818b1a75-f10b-46b9-bf7c-635c3b92a50f
parent 4e8a48da
...@@ -166,7 +166,8 @@ typedef struct itti_desc_s { ...@@ -166,7 +166,8 @@ typedef struct itti_desc_s {
task_id_t task_max; task_id_t task_max;
MessagesIds messages_id_max; MessagesIds messages_id_max;
pthread_t thread_handling_signals; boolean_t thread_handling_signals;
pthread_t thread_ref;
const task_info_t *tasks_info; const task_info_t *tasks_info;
const message_info_t *messages_info; const message_info_t *messages_info;
...@@ -791,8 +792,8 @@ void itti_terminate_tasks(task_id_t task_id) { ...@@ -791,8 +792,8 @@ void itti_terminate_tasks(task_id_t task_id) {
// Sends Terminate signals to all tasks. // Sends Terminate signals to all tasks.
itti_send_terminate_message (task_id); itti_send_terminate_message (task_id);
if (itti_desc.thread_handling_signals >= 0) { if (itti_desc.thread_handling_signals) {
pthread_kill (itti_desc.thread_handling_signals, SIGUSR1); pthread_kill (itti_desc.thread_ref, SIGUSR1);
} }
pthread_exit (NULL); pthread_exit (NULL);
...@@ -856,7 +857,7 @@ int itti_init(task_id_t task_max, thread_id_t thread_max, MessagesIds messages_i ...@@ -856,7 +857,7 @@ int itti_init(task_id_t task_max, thread_id_t thread_max, MessagesIds messages_i
itti_desc.task_max = task_max; itti_desc.task_max = task_max;
itti_desc.thread_max = thread_max; itti_desc.thread_max = thread_max;
itti_desc.messages_id_max = messages_id_max; itti_desc.messages_id_max = messages_id_max;
itti_desc.thread_handling_signals = -1; itti_desc.thread_handling_signals = FALSE;
itti_desc.tasks_info = tasks_info; itti_desc.tasks_info = tasks_info;
itti_desc.messages_info = messages_info; itti_desc.messages_info = messages_info;
...@@ -975,7 +976,8 @@ void itti_wait_tasks_end(void) { ...@@ -975,7 +976,8 @@ void itti_wait_tasks_end(void) {
int result; int result;
int retries = 10; int retries = 10;
itti_desc.thread_handling_signals = pthread_self (); itti_desc.thread_handling_signals = TRUE;
itti_desc.thread_ref=pthread_self ();
/* Handle signals here */ /* Handle signals here */
while (end == 0) { while (end == 0) {
......
...@@ -362,7 +362,7 @@ NwGtpv1uCreateTunnelEndPoint( NW_IN NwGtpv1uStackT *thiz, ...@@ -362,7 +362,7 @@ NwGtpv1uCreateTunnelEndPoint( NW_IN NwGtpv1uStackT *thiz,
"Tunnel already exists", teid); "Tunnel already exists", teid);
rc = nwGtpTunnelEndPointDestroy(thiz, pTunnelEndPoint); rc = nwGtpTunnelEndPointDestroy(thiz, pTunnelEndPoint);
NW_ASSERT(rc == NW_GTPV1U_OK); NW_ASSERT(rc == NW_GTPV1U_OK);
*phStackSession = (NwGtpv1uStackSessionHandleT) 0; *phStackSession = (NwGtpv1uStackSessionHandleT) NULL;
NW_ASSERT(0); NW_ASSERT(0);
rc = NW_GTPV1U_FAILURE; rc = NW_GTPV1U_FAILURE;
} else { } else {
......
...@@ -495,8 +495,8 @@ nwGtpv1uMsgHexDump(NwGtpv1uMsgHandleT hMsg, FILE *fp) ...@@ -495,8 +495,8 @@ nwGtpv1uMsgHexDump(NwGtpv1uMsgHandleT hMsg, FILE *fp)
for(n=1; n<=size; n++) { for(n=1; n<=size; n++) {
if (n%16 == 1) { if (n%16 == 1) {
/* store address for this line */ /* store address for this line */
snprintf(addrstr, sizeof(addrstr), "%.4x", snprintf(addrstr, sizeof(addrstr), "%.4lx",
((unsigned int)p-(unsigned int)data) ); (p-data) );
} }
c = *p; c = *p;
......
...@@ -92,8 +92,8 @@ nwGtpv1uTrxnPeerRspTimeout(void *arg) ...@@ -92,8 +92,8 @@ nwGtpv1uTrxnPeerRspTimeout(void *arg)
NW_ASSERT(pStack); NW_ASSERT(pStack);
NW_LOG(pStack, NW_LOG_LEVEL_WARN, "T3 timer expired for transaction 0x%x", NW_LOG(pStack, NW_LOG_LEVEL_WARN, "T3 timer expired for transaction 0x%p",
(unsigned int)thiz); thiz);
rc = nwGtpv1uTrxnSendMsgRetransmission(thiz); rc = nwGtpv1uTrxnSendMsgRetransmission(thiz);
...@@ -213,7 +213,7 @@ nwGtpv1uTrxnNew( NW_IN NwGtpv1uStackT *thiz, ...@@ -213,7 +213,7 @@ nwGtpv1uTrxnNew( NW_IN NwGtpv1uStackT *thiz,
rc = NW_GTPV1U_FAILURE; rc = NW_GTPV1U_FAILURE;
} }
NW_LOG(thiz, NW_LOG_LEVEL_DEBG, "Created transaction 0x%X", (unsigned int)pTrxn); NW_LOG(thiz, NW_LOG_LEVEL_DEBG, "Created transaction 0x%p", pTrxn);
*ppTrxn = pTrxn; *ppTrxn = pTrxn;
...@@ -254,7 +254,7 @@ nwGtpv1uTrxnWithSeqNew( NW_IN NwGtpv1uStackT *thiz, ...@@ -254,7 +254,7 @@ nwGtpv1uTrxnWithSeqNew( NW_IN NwGtpv1uStackT *thiz,
rc = NW_GTPV1U_FAILURE; rc = NW_GTPV1U_FAILURE;
} }
NW_LOG(thiz, NW_LOG_LEVEL_DEBG, "Created transaction 0x%X", (unsigned int)pTrxn); NW_LOG(thiz, NW_LOG_LEVEL_DEBG, "Created transaction 0x%p", pTrxn);
*ppTrxn = pTrxn; *ppTrxn = pTrxn;
...@@ -290,7 +290,7 @@ nwGtpv1uTrxnDelete( NW_INOUT NwGtpv1uTrxnT **pthiz) ...@@ -290,7 +290,7 @@ nwGtpv1uTrxnDelete( NW_INOUT NwGtpv1uTrxnT **pthiz)
thiz->next = gpGtpv1uTrxnPool; thiz->next = gpGtpv1uTrxnPool;
gpGtpv1uTrxnPool = thiz; gpGtpv1uTrxnPool = thiz;
NW_LOG(pStack, NW_LOG_LEVEL_DEBG, "Purged transaction 0x%X", (unsigned int)thiz); NW_LOG(pStack, NW_LOG_LEVEL_DEBG, "Purged transaction 0x%p", thiz);
*pthiz = NULL; *pthiz = NULL;
return rc; return rc;
......
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