aboutsummaryrefslogtreecommitdiffstats
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 18:38:06 +0200
commita5a7075fe5ad626178b25266beafddddecea2c02 (patch)
treef6989497462a1a863cbf50007ea7e2929421d03a
parent2b4e3660831d8ac65768250709dee46708ab0136 (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.
-rw-r--r--openbsc/src/paging.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/openbsc/src/paging.c b/openbsc/src/paging.c
index 3d16a21fb..155f932bb 100644
--- a/openbsc/src/paging.c
+++ b/openbsc/src/paging.c
@@ -133,6 +133,19 @@ 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->available_slots = 20;
+ }
+
if (!paging_bts->last_request)
paging_bts->last_request =
(struct gsm_paging_request *)paging_bts->pending_requests.next;