From 33ed0f88765d6b2c8a838e1611c470d33d835ef1 Mon Sep 17 00:00:00 2001 From: Vadim Yanitskiy Date: Wed, 17 Jul 2019 18:14:15 +0700 Subject: common/rsl.c: fix: properly handle SI3 Rest Octets It was noticed with old Sony Ericsson phones (like W595 and K510i) that the service provided by Osmocom network becomes unreliable from time to time. The RSSI indicator on those phones shows that the signal is lost, so neither CS nor PS services are working. As it then turned out, System Information 3 broadcasted on the Um interface is different than the one received from the BSC. In particular, the content of SI3 Rest Octets IE is different. Among with the 'GPRS Indicator', which is actually expected to indicate whether the PCU is connected or not, SI3 Rest Octets on the Um interface contain both 'Optional Power Offset' and 'Scheduling if and where' IEs, which are not present in the original messages from the BSC. Moreover, as soon as the PCU is connected, 'GPRS Indicator' IE contains different 'GPRS RA Colour' value, and informs the MS that System Information 13 is sent on extended BCCH, which is not even supported by OsmoBTS! The culprit is in rsl_rx_bcch_info(), where we pass a pointer to osmo_gsm48_rest_octets_si3_decode(). Instead of passing a pointer to the beginning of SI3 buffer, we actually need to shift it to the beginning of the SI3 Rest Octets IE. This change makes my Sony Ericsson phones happy ;) Change-Id: Ia962cf21903ba674057cf52746996dd3254bc1c6 --- src/common/rsl.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/common/rsl.c') diff --git a/src/common/rsl.c b/src/common/rsl.c index 0a6a4e58..d09dc4a4 100644 --- a/src/common/rsl.c +++ b/src/common/rsl.c @@ -368,7 +368,9 @@ static int rsl_rx_bcch_info(struct gsm_bts_trx *trx, struct msgb *msg) LCHAN_REL_ACT_REACT; } /* decode original SI3 Rest Octets as sent by BSC */ - osmo_gsm48_rest_octets_si3_decode(&bts->si3_ro_decoded, GSM_BTS_SI(bts, osmo_si)); + const uint8_t *si3_ro_buf = (uint8_t *) GSM_BTS_SI(bts, osmo_si); + si3_ro_buf += offsetof(struct gsm48_system_information_type_3, rest_octets); + osmo_gsm48_rest_octets_si3_decode(&bts->si3_ro_decoded, si3_ro_buf); /* patch out GPRS indicator from binary if PCU is not connected; will be enabled * after PCU connects */ regenerate_si3_restoctets(bts); -- cgit v1.2.3