[PATCH 1/2] [signal] Differentiate paging success from expiration in SS_PAGING

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/OpenBSC@lists.osmocom.org/.

Sylvain Munaut 246tnt at gmail.com
Sun Dec 20 12:42:16 UTC 2009


From: Sylvain Munaut <tnt at 246tNt.com>

This is useful information to know and actually fixes a segfault
in rllp.c where lchan is accessed even tough it could be NULL in
case of failure.

Signed-off-by: Sylvain Munaut <tnt at 246tNt.com>
---
 openbsc/include/openbsc/signal.h |    3 ++-
 openbsc/src/gsm_04_08_utils.c    |    2 +-
 openbsc/src/paging.c             |    2 +-
 openbsc/src/rrlp.c               |    4 +++-
 4 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/openbsc/include/openbsc/signal.h b/openbsc/include/openbsc/signal.h
index 8c815f8..3680d56 100644
--- a/openbsc/include/openbsc/signal.h
+++ b/openbsc/include/openbsc/signal.h
@@ -45,7 +45,8 @@ enum signal_subsystems {
 
 /* SS_PAGING signals */
 enum signal_paging {
-	S_PAGING_COMPLETED,
+	S_PAGING_SUCCEEDED,
+	S_PAGING_EXPIRED,
 };
 
 /* SS_SMS signals */
diff --git a/openbsc/src/gsm_04_08_utils.c b/openbsc/src/gsm_04_08_utils.c
index e96a1ca..2183743 100644
--- a/openbsc/src/gsm_04_08_utils.c
+++ b/openbsc/src/gsm_04_08_utils.c
@@ -488,7 +488,7 @@ int gsm48_handle_paging_resp(struct msgb *msg, struct gsm_subscriber *subscr)
 	sig_data.bts	= msg->lchan->ts->trx->bts;
 	sig_data.lchan	= msg->lchan;
 
-	dispatch_signal(SS_PAGING, S_PAGING_COMPLETED, &sig_data);
+	dispatch_signal(SS_PAGING, S_PAGING_SUCCEEDED, &sig_data);
 
 	/* Stop paging on the bts we received the paging response */
 	paging_request_stop(msg->trx->bts, subscr, msg->lchan);
diff --git a/openbsc/src/paging.c b/openbsc/src/paging.c
index b273419..6cd4d05 100644
--- a/openbsc/src/paging.c
+++ b/openbsc/src/paging.c
@@ -212,7 +212,7 @@ static void paging_T3113_expired(void *data)
 	cbfn = req->cbfn;
 	paging_remove_request(&req->bts->paging, req);
 
-	dispatch_signal(SS_PAGING, S_PAGING_COMPLETED, &sig_data);
+	dispatch_signal(SS_PAGING, S_PAGING_EXPIRED, &sig_data);
 	if (cbfn)
 		cbfn(GSM_HOOK_RR_PAGING, GSM_PAGING_EXPIRED, NULL, NULL,
 			  cbfn_param);
diff --git a/openbsc/src/rrlp.c b/openbsc/src/rrlp.c
index 60ce750..3504451 100644
--- a/openbsc/src/rrlp.c
+++ b/openbsc/src/rrlp.c
@@ -89,10 +89,12 @@ static int paging_sig_cb(unsigned int subsys, unsigned int signal,
 	struct paging_signal_data *psig_data = signal_data;
 
 	switch (signal) {
-	case S_PAGING_COMPLETED:
+	case S_PAGING_SUCCEEDED:
 		/* A subscriber has attached. */
 		send_rrlp_req(psig_data->lchan);
 		break;
+	case S_PAGING_EXPIRED:
+		break;
 	}
 	return 0;
 }
-- 
1.6.5.1





More information about the OpenBSC mailing list