aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/src/libbsc/system_information.c
diff options
context:
space:
mode:
authorMax <msuraev@sysmocom.de>2016-05-18 13:04:47 +0200
committerHolger Freyther <holger@freyther.de>2016-05-31 09:32:12 +0000
commit69e9c0dfc6cc10c07d03f8800d8ff7197fe97c8b (patch)
treed54d4a96e6ed18afe30e7c9d870a5586ea758a9f /openbsc/src/libbsc/system_information.c
parent82dd983dd85c04b5aa013365334f2a249140902e (diff)
Make si2q scheduling optional
Previously si2quater SI messages were always scheduled. Check for neighbor configuration and only schedule si2q when necessary. Add corresponding unit test. Change-Id: Ibe997803ffb894133fd4d838410fe735791d414f Fixes: OS#1727 Reviewed-on: https://gerrit.osmocom.org/81 Tested-by: Jenkins Builder Reviewed-by: Holger Freyther <holger@freyther.de>
Diffstat (limited to 'openbsc/src/libbsc/system_information.c')
-rw-r--r--openbsc/src/libbsc/system_information.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/openbsc/src/libbsc/system_information.c b/openbsc/src/libbsc/system_information.c
index d40bbaf52..fd228e398 100644
--- a/openbsc/src/libbsc/system_information.c
+++ b/openbsc/src/libbsc/system_information.c
@@ -648,7 +648,7 @@ static int generate_si2ter(uint8_t *output, struct gsm_bts *bts)
static int generate_si2quater(uint8_t *output, struct gsm_bts *bts)
{
- int rc;
+ int rc, i = MAX_EARFCN_LIST;
struct gsm48_system_information_type_2quater *si2q =
(struct gsm48_system_information_type_2quater *) output;
@@ -667,6 +667,14 @@ static int generate_si2quater(uint8_t *output, struct gsm_bts *bts)
if (rc < 0)
return rc;
+ if (bts->si_common.si2quater_neigh_list.arfcn)
+ for (i = 0; i < MAX_EARFCN_LIST; i++)
+ if (bts->si_common.si2quater_neigh_list.arfcn[i] !=
+ OSMO_EARFCN_INVALID)
+ break;
+ if (!bts->si_common.uarfcn_length && i == MAX_EARFCN_LIST)
+ bts->si_valid &= ~(1 << SYSINFO_TYPE_2quater);
+
return sizeof(*si2q) + rc;
}