aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorStefan Sperling <ssperling@sysmocom.de>2018-06-07 17:09:45 +0200
committerStefan Sperling <ssperling@sysmocom.de>2018-06-07 17:14:16 +0200
commit39a1d10c11b17eec9b8a2708f1d3b91890dec650 (patch)
tree67b8d87c1762768620b9a622753e607573d456e5 /src
parentb5f81b9fbd5de8ef45bffbe6136ac843f96f7130 (diff)
increment 'paging responded' counter for active paging only
Only count paging responses which can be mapped to an active paging. Unsolicited paging responses which do not correspond to an active paging would increment the 'paging response' counter. This means the number of paging attempts could be smaller than the number of paging responses, which can look confusing in the 'show statistics' VTY command. Change-Id: I7cfc7c29fb7570d41e3ac23cca17f5b98b303506 Related: OS#66
Diffstat (limited to 'src')
-rw-r--r--src/libbsc/paging.c20
1 files changed, 12 insertions, 8 deletions
diff --git a/src/libbsc/paging.c b/src/libbsc/paging.c
index cdcae51f7..d6bff2a42 100644
--- a/src/libbsc/paging.c
+++ b/src/libbsc/paging.c
@@ -352,11 +352,12 @@ int paging_request_bts(struct gsm_bts *bts, struct bsc_subscr *bsub, int type,
* \param[in] bts BTS on which we shall stop paging
* \param[in] bsub subscriber which we shall stop paging
* \param[in] conn connection to the subscriber (if any)
- * \param[in] msg message received from subscrbier (if any) */
+ * \param[in] msg message received from subscrbier (if any)
+ * \returns 0 if an active paging request was stopped, an error code otherwise. */
/* we consciously ignore the type of the request here */
-static void _paging_request_stop(struct gsm_bts *bts, struct bsc_subscr *bsub,
- struct gsm_subscriber_connection *conn,
- struct msgb *msg)
+static int _paging_request_stop(struct gsm_bts *bts, struct bsc_subscr *bsub,
+ struct gsm_subscriber_connection *conn,
+ struct msgb *msg)
{
struct gsm_bts_paging_state *bts_entry = &bts->paging;
struct gsm_paging_request *req, *req2;
@@ -370,9 +371,11 @@ static void _paging_request_stop(struct gsm_bts *bts, struct bsc_subscr *bsub,
paging_remove_request(&bts->paging, req);
LOGP(DPAG, LOGL_DEBUG, "(bts=%d) Stop paging %s\n", bts->nr,
bsc_subscr_name(bsub));
- break;
+ return 0;
}
}
+
+ return -ENOENT;
}
/*! Stop paging on all other bts'
@@ -391,9 +394,10 @@ void paging_request_stop(struct llist_head *bts_list,
/* Stop this first and dispatch the request */
if (_bts) {
- _paging_request_stop(_bts, bsub, conn, msg);
- rate_ctr_inc(&_bts->bts_ctrs->ctr[BTS_CTR_PAGING_RESPONDED]);
- rate_ctr_inc(&_bts->network->bsc_ctrs->ctr[BSC_CTR_PAGING_RESPONDED]);
+ if (_paging_request_stop(_bts, bsub, conn, msg) == 0) {
+ rate_ctr_inc(&_bts->bts_ctrs->ctr[BTS_CTR_PAGING_RESPONDED]);
+ rate_ctr_inc(&_bts->network->bsc_ctrs->ctr[BSC_CTR_PAGING_RESPONDED]);
+ }
}
/* Make sure to cancel this everywhere else */