[PATCH] osmo-bts[master]: Ensure we don't send dummy UI frames on BCCH for TC=5

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

Harald Welte gerrit-no-reply at lists.osmocom.org
Sat Jul 15 20:36:45 UTC 2017


Review at  https://gerrit.osmocom.org/3259

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
---
M src/common/sysinfo.c
1 file changed, 7 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/59/3259/1

diff --git a/src/common/sysinfo.c b/src/common/sysinfo.c
index 9276c7b..cf86380 100644
--- a/src/common/sysinfo.c
+++ b/src/common/sysinfo.c
@@ -129,6 +129,10 @@
 		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 @@
 		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)

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ifeaed27d1d7ba9994fb8ce67d660648bcc8efece
Gerrit-PatchSet: 1
Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Owner: Harald Welte <laforge at gnumonks.org>



More information about the gerrit-log mailing list