From c6382b5e0b4790d15681e89f704465160b9aef1d Mon Sep 17 00:00:00 2001 From: Pau Espin Pedrol Date: Tue, 27 Mar 2018 14:15:40 +0200 Subject: bsc: paging: Fix losing paging messages for BTS Since eb241aa1d5720a36cf97f29390c2890cf3aecba7 (year 2010) we are delaying transmission of paging packets 500ms in order to avoid crashing the nanobts because of sending too many packets. In consequence, if 2 BSSMAP PAGING messages arrived in less than 500ms, since the 1st one was already in the queue, when 2nd one was handled then paging_request_bts would return -EEXIST (negative value) and paging_request_stop was called which would remove the paging in the queue. As a result, the paging would be lost unless a new 3rd BSSMAP PAGING message would arrive after this second one (which of course could be again removed by a 4th sent less than 500ms afterwards), and so on. Furthermore, it doesn't make sense to call stop_paging in here, so the easy fix is to remove it to avoid the issue mentioned above. Change-Id: I2605367b2735b48bce2b31504c444360b5ca6953 --- openbsc/src/libbsc/paging.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/openbsc/src/libbsc/paging.c b/openbsc/src/libbsc/paging.c index 22c676fe9..9bf1a57d1 100644 --- a/openbsc/src/libbsc/paging.c +++ b/openbsc/src/libbsc/paging.c @@ -346,12 +346,12 @@ int paging_request(struct gsm_network *network, struct bsc_subscr *bsub, break; rc = paging_request_bts(bts, bsub, type, cbfn, data); - if (rc < 0) { - paging_request_stop(&network->bts_list, NULL, bsub, - NULL, NULL); + if (rc >= 0) + num_pages += rc; + else if (rc == -EEXIST) + num_pages += 1; + else return rc; - } - num_pages += rc; } while (1); if (num_pages == 0) -- cgit v1.2.3