aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2017-07-15 22:32:52 +0200
committerHarald Welte <laforge@gnumonks.org>2017-07-15 22:36:10 +0200
commit3617fd1cb6eb3e22a1f1482e05a8d1d8cb9016f1 (patch)
tree14d012b871bbfed88aeea0e9f825d2049f1aaf44
parente0e2b9e30338b9cfe3892c326d82b4a37860e7f1 (diff)
Ensure we don't send dummy UI frames on BCCH for TC=5
When no SI 2bis, nor 2ter, nor 2quater is in use, then the code in bts_sysinfo_get() will return null, causing the transmission of a dummy frame (0303012B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B) instead of a system information message. This is - at least - very odd and might not be backed by the specification. We should simply send any other system information message instead of sending a frame that does not have a valid SI header. While 030301 might be a valid, empty UI frame on a DCCH, it is not a valid frame for the BCCH, where the header is structured differently. In fact, bts_sysinfo_get() should never return NULL and always return a valid BCCH message. This bug was found while developing http://git.osmocom.org/osmo-ttcn3-hacks/tree/sysinfo/Test.ttcn Change-Id: Ifeaed27d1d7ba9994fb8ce67d660648bcc8efece Closes: OS#2365
-rw-r--r--src/common/sysinfo.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/common/sysinfo.c b/src/common/sysinfo.c
index 9276c7bb..cf863804 100644
--- a/src/common/sysinfo.c
+++ b/src/common/sysinfo.c
@@ -129,6 +129,10 @@ uint8_t *bts_sysinfo_get(struct gsm_bts *bts, const struct gsm_time *g_time)
else if (GSM_BTS_HAS_SI(bts, SYSINFO_TYPE_2quater) &&
!GSM_BTS_HAS_SI(bts, SYSINFO_TYPE_2bis) && !GSM_BTS_HAS_SI(bts, SYSINFO_TYPE_2ter))
return get_si2q_inc_index(bts);
+
+ /* simply send SI2 if we have nothing else to send */
+ else
+ return GSM_BTS_SI(bts, SYSINFO_TYPE_2);
break;
case 6:
return GSM_BTS_SI(bts, SYSINFO_TYPE_3);
@@ -136,7 +140,9 @@ uint8_t *bts_sysinfo_get(struct gsm_bts *bts, const struct gsm_time *g_time)
return GSM_BTS_SI(bts, SYSINFO_TYPE_4);
}
- return NULL;
+ /* this should never bve reached. We must transmit a BCCH
+ * message on the normal BCCH in all cases. */
+ OSMO_ASSERT(0);
}
uint8_t num_agch(struct gsm_bts_trx *trx, const char * arg)