Harald Welte has submitted this change and it was merged.

Change subject: paging: Drop + Log paging requests for non-existant paging 
groups
......................................................................


paging: Drop + Log paging requests for non-existant paging groups

Change-Id: Id02c8fea51c1260f1baae8566c67bafc5bdb970e
Related: OS#2992
---
M src/common/paging.c
1 file changed, 9 insertions(+), 0 deletions(-)

Approvals:
  Harald Welte: Looks good to me, approved; Verified



diff --git a/src/common/paging.c b/src/common/paging.c
index d796176..c5c23d7 100644
--- a/src/common/paging.c
+++ b/src/common/paging.c
@@ -35,6 +35,7 @@
 
 #include <osmocom/gsm/protocol/gsm_04_08.h>
 #include <osmocom/gsm/gsm0502.h>
+#include <osmocom/gsm/gsm48.h>
 
 #include <osmo-bts/bts.h>
 #include <osmo-bts/rsl.h>
@@ -177,10 +178,18 @@
                        const uint8_t *identity_lv, uint8_t chan_needed)
 {
        struct llist_head *group_q = &ps->paging_queue[paging_group];
+       int blocks = gsm48_number_of_paging_subchannels(&ps->chan_desc);
        struct paging_record *pr;
 
        rate_ctr_inc2(ps->btsb->bts->ctrs, BTS_CTR_PAGING_RCVD);
 
+       if (paging_group >= blocks) {
+               LOGP(DPAG, LOGL_ERROR, "BSC Send PAGING for group %u, but 
number of paging "
+                       "sub-channels is only %u\n", paging_group, blocks);
+               rate_ctr_inc2(ps->btsb->bts->ctrs, BTS_CTR_PAGING_DROP);
+               return -EINVAL;
+       }
+
        if (ps->num_paging >= ps->num_paging_max) {
                LOGP(DPAG, LOGL_NOTICE, "Dropping paging, queue full (%u)\n",
                        ps->num_paging);

-- 
To view, visit https://gerrit.osmocom.org/6880
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Id02c8fea51c1260f1baae8566c67bafc5bdb970e
Gerrit-PatchSet: 3
Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Owner: Harald Welte <[email protected]>
Gerrit-Reviewer: Harald Welte <[email protected]>
Gerrit-Reviewer: Jenkins Builder

Reply via email to