aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNeels Hofmeyr <nhofmeyr@sysmocom.de>2016-05-04 12:40:05 +0200
committerNeels Hofmeyr <nhofmeyr@sysmocom.de>2016-05-04 13:20:11 +0200
commit1d125c902fa163904dfa5364b82552cbabf6f7dd (patch)
tree3b47e77404df9af78f04d1795c47f4f79c87c7d5
parent35ebbbea7a72103b3722e6e3ce59d71f5579a61d (diff)
subscr_paging_dispatch(): add assertions
Make sure that subscr and conn are valid: * a subscr must always be present. * on success, a conn must be present and the subscr must match the conn's subscr. Also check the hooknum.
-rw-r--r--openbsc/src/libmsc/gsm_subscriber.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/openbsc/src/libmsc/gsm_subscriber.c b/openbsc/src/libmsc/gsm_subscriber.c
index 19c0b0f0..950c5a00 100644
--- a/openbsc/src/libmsc/gsm_subscriber.c
+++ b/openbsc/src/libmsc/gsm_subscriber.c
@@ -66,6 +66,11 @@ static int subscr_paging_dispatch(unsigned int hooknum, unsigned int event,
struct gsm_subscriber *subscr = param;
struct paging_signal_data sig_data;
+ OSMO_ASSERT(hooknum == GSM_HOOK_RR_PAGING);
+ OSMO_ASSERT(subscr);
+ OSMO_ASSERT(!(conn && (conn->subscr != subscr)));
+ OSMO_ASSERT(!((event == GSM_PAGING_SUCCEEDED) && !conn));
+
LOGP(DPAG, LOGL_DEBUG, "Paging %s for %s (event=%d)\n",
event == GSM_PAGING_SUCCEEDED ? "success" : "failure",
subscr_name(subscr), event);