aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/src/paging.c
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <zecke@selfish.org>2010-04-09 18:38:06 +0200
committerHolger Hans Peter Freyther <zecke@selfish.org>2010-04-09 23:59:52 +0200
commit19722d44116353c14de8cb1f09eb45b9f8ec8ae2 (patch)
treeee3e0558f19f2c4fe4cc017fec28341bdd6484f5 /openbsc/src/paging.c
parent07d838a3bf866692f15d6d3bbc17e91451ace216 (diff)
paging: Avoid integer underflow on ipaccess
On the nanoBTS we do not receive any load indication for the paging channel and we just decrement our available slots and the unsigned int wraps to the maximum value. Together with a not yet understood bug this makes us go amock. For the nanoBTS and even the Siemens BS11 resetting the load to 20 after two seconds should be just fine. For the nanoBTS we would need to reset the 20 a lot more earlier but we need to take a look at how often we run low.
Diffstat (limited to 'openbsc/src/paging.c')
-rw-r--r--openbsc/src/paging.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/openbsc/src/paging.c b/openbsc/src/paging.c
index 3d16a21fb..2ae3fc6bf 100644
--- a/openbsc/src/paging.c
+++ b/openbsc/src/paging.c
@@ -133,6 +133,20 @@ static void paging_handle_pending_requests(struct gsm_bts_paging_state *paging_b
return;
}
+ /*
+ * In case the BTS does not provide us with load indication just fill
+ * up our slots for this round. We should be able to page 20 subscribers
+ * every two seconds. So we will just give the BTS some extra credit.
+ * We will have to see how often we run out of this credit, so we might
+ * need a low watermark and then add credit or give 20 every run when
+ * the bts sets an option for that.
+ */
+ if (paging_bts->available_slots == 0) {
+ LOGP(DPAG, LOGL_NOTICE, "No slots available on bts nr %d\n",
+ paging_bts->bts->nr);
+ paging_bts->available_slots = 20;
+ }
+
if (!paging_bts->last_request)
paging_bts->last_request =
(struct gsm_paging_request *)paging_bts->pending_requests.next;