laforge submitted this change.

View Change


Approvals: Jenkins Builder: Verified pespin: Looks good to me, but someone else must approve laforge: Looks good to me, approved
gsm_data: fix wrong variable set in gsm_pchan2chan_nr()

I believe the actual intention was to reset the 'lchan_nr' variable,
and not the 'chan_nr'. The 'lchan_nr' is used to compose the 'cbits':

cbits = 0x04;
cbits += lchan_nr;

If the value is 4, then the result is:

cbits = 0x04 + 4 = 0x08

which corresponds to SDCCH8 (not SDCCH4), and is clearly wrong.

Change-Id: Ic9c7c2e46e24dab0b721221e9adcbbae2ca56d23
Fixes: ec1b5a0e9 "gsm_ts2chan_nr(): add assertions for lchan_nr"
Fixes: CID#336586
---
M src/osmo-bsc/gsm_data.c
1 file changed, 25 insertions(+), 2 deletions(-)

diff --git a/src/osmo-bsc/gsm_data.c b/src/osmo-bsc/gsm_data.c
index 580fa84..4d77e75 100644
--- a/src/osmo-bsc/gsm_data.c
+++ b/src/osmo-bsc/gsm_data.c
@@ -485,8 +485,8 @@
* See osmo-bts-xxx/oml.c:opstart_compl().
*/
if (lchan_nr == CCCH_LCHAN)
- chan_nr = 0;
- else if (lchan_nr >= 4)
+ lchan_nr = 0;
+ else if (lchan_nr > 4)
return -EINVAL;
cbits = 0x04;
cbits += lchan_nr;

To view, visit change 35288. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: Ic9c7c2e46e24dab0b721221e9adcbbae2ca56d23
Gerrit-Change-Number: 35288
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria <vyanitskiy@sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge@osmocom.org>
Gerrit-Reviewer: neels <nhofmeyr@sysmocom.de>
Gerrit-Reviewer: pespin <pespin@sysmocom.de>
Gerrit-MessageType: merged