From d9202b342c996c56a7e10dbc744e50d56a933b2c Mon Sep 17 00:00:00 2001 From: Neels Hofmeyr Date: Mon, 2 May 2016 16:19:29 +0200 Subject: comments and debug log for paging response --- openbsc/src/libmsc/gsm_subscriber.c | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/openbsc/src/libmsc/gsm_subscriber.c b/openbsc/src/libmsc/gsm_subscriber.c index 1a730f866..96da9e75b 100644 --- a/openbsc/src/libmsc/gsm_subscriber.c +++ b/openbsc/src/libmsc/gsm_subscriber.c @@ -66,6 +66,9 @@ static int subscr_paging_dispatch(unsigned int hooknum, unsigned int event, struct gsm_subscriber *subscr = conn->subscr; struct paging_signal_data sig_data; + LOGP(DPAG, LOGL_DEBUG, "Running paging response action for %s\n", + subscr_name(conn->subscr)); + if (!subscr->is_paging) { LOGP(DPAG, LOGL_NOTICE, "Paging Response received for subscriber" @@ -85,12 +88,18 @@ static int subscr_paging_dispatch(unsigned int hooknum, unsigned int event, llist_for_each_entry_safe(request, tmp, &subscr->requests, entry) { llist_del(&request->entry); - request->cbfn(hooknum, event, msg, data, request->param); + if (request->cbfn) { + LOGP(DPAG, LOGL_DEBUG, "Calling paging cbfn.\n"); + request->cbfn(hooknum, event, msg, data, request->param); + } else + LOGP(DPAG, LOGL_DEBUG, "Paging without action.\n"); talloc_free(request); } /* balanced with the moment we start paging */ subscr->is_paging = 0; + + /* balanced with the moment we receive a paging response */ subscr_put(subscr); return 0; } @@ -99,9 +108,15 @@ static int subscr_paging_sec_cb(unsigned int hooknum, unsigned int event, struct msgb *msg, void *data, void *param) { int rc; + struct gsm_subscriber_connection *conn = data; + OSMO_ASSERT(conn); switch (event) { case GSM_SECURITY_AUTH_FAILED: + LOGP(DPAG, LOGL_ERROR, + "Dropping Paging Response:" + " authorization failed for subscriber %s\n", + subscr_name(conn->subscr)); rc = subscr_paging_dispatch( GSM_HOOK_RR_PAGING, GSM_PAGING_EXPIRED, msg, data, NULL); @@ -115,6 +130,8 @@ static int subscr_paging_sec_cb(unsigned int hooknum, unsigned int event, break; default: + LOGP(DPAG, LOGL_FATAL, + "Invalid authorization event: %d\n", event); rc = -EINVAL; } -- cgit v1.2.3