diff options
author | Holger Hans Peter Freyther <holger@moiji-mobile.com> | 2015-08-08 20:44:42 +0200 |
---|---|---|
committer | Holger Hans Peter Freyther <holger@moiji-mobile.com> | 2015-08-08 20:44:42 +0200 |
commit | e019b564eccaf63ca372db6811dfa3dd6c4d9084 (patch) | |
tree | e5c1d729eb01e90f38f4a193e63602717595156b /openbsc/src/libbsc/paging.c | |
parent | daaea0c84fee46d9b63b746d5ed2cdf66f990352 (diff) | |
parent | eb48cafac9af84586679a4ce4caeb985ef0b1eb1 (diff) |
Merge branch 'zecke/changes/paging-order'
Various paging clean-ups. I couldn't re-produce the assert that
was hit by Rhizomatica in the subscriber code. Let's clean things
up a bit to avoid some of the potential issues this code had.
Always stop paging regardless of where the subscriber is at the
time of the cancellation.
Diffstat (limited to 'openbsc/src/libbsc/paging.c')
-rw-r--r-- | openbsc/src/libbsc/paging.c | 29 |
1 files changed, 12 insertions, 17 deletions
diff --git a/openbsc/src/libbsc/paging.c b/openbsc/src/libbsc/paging.c index 8bc10e670..9ae28e0c4 100644 --- a/openbsc/src/libbsc/paging.c +++ b/openbsc/src/libbsc/paging.c @@ -341,8 +341,10 @@ int paging_request(struct gsm_network *network, struct gsm_subscriber *subscr, break; rc = paging_request_bts(bts, subscr, type, cbfn, data); - if (rc < 0) + if (rc < 0) { + paging_request_stop(NULL, subscr, NULL, NULL); return rc; + } num_pages += rc; } while (1); @@ -389,28 +391,21 @@ void paging_request_stop(struct gsm_bts *_bts, struct gsm_subscriber *subscr, struct gsm_subscriber_connection *conn, struct msgb *msg) { - struct gsm_bts *bts = NULL; + struct gsm_bts *bts; log_set_context(BSC_CTX_SUBSCR, subscr); + /* Stop this first and dispatch the request */ if (_bts) _paging_request_stop(_bts, subscr, conn, msg); - do { - /* - * FIXME: Don't use the lac of the subscriber... - * as it might have magically changed the lac.. use the - * location area of the _bts as reconfiguration of the - * network is probably happening less often. - */ - bts = gsm_bts_by_lac(subscr->group->net, subscr->lac, bts); - if (!bts) - break; - - /* Stop paging */ - if (bts != _bts) - _paging_request_stop(bts, subscr, NULL, NULL); - } while (1); + /* Make sure to cancel this everywhere else */ + llist_for_each_entry(bts, &subscr->group->net->bts_list, list) { + /* Sort of an optimization. */ + if (bts == _bts) + continue; + _paging_request_stop(bts, subscr, NULL, NULL); + } } void paging_update_buffer_space(struct gsm_bts *bts, uint16_t free_slots) |