fixeria has uploaded this change for review.

View Change

l1sap: fix logic error in gsmtap_csd_rlp_process()

Current code evaluates as follows:

(trx->arfcn | is_uplink) ? GSMTAP_ARFCN_F_UPLINK : 0

while we want it to be evaluated as follows:

trx->arfcn | (is_uplink ? GSMTAP_ARFCN_F_UPLINK : 0)

Change-Id: Ida3d684968a3e4a45531d4b6d7b6af170e3e39f4
Fixes: CID#338165
---
M src/common/l1sap.c
1 file changed, 24 insertions(+), 2 deletions(-)

git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/68/35468/1
diff --git a/src/common/l1sap.c b/src/common/l1sap.c
index e9095de..11f5e3f 100644
--- a/src/common/l1sap.c
+++ b/src/common/l1sap.c
@@ -1858,6 +1858,7 @@
struct gsmtap_inst *inst = trx->bts->gsmtap.inst;
struct osmo_rlp_frame_decoded rlpf;
pbit_t *rlp_buf;
+ uint16_t arfcn;
int byte_len;

if (!inst || !trx->bts->gsmtap.rlp)
@@ -1916,8 +1917,11 @@
return;
}

- gsmtap_send_ex(inst, GSMTAP_TYPE_GSM_RLP, trx->arfcn | is_uplink ? GSMTAP_ARFCN_F_UPLINK : 0,
- lchan->ts->nr,
+ arfcn = trx->arfcn;
+ if (is_uplink)
+ arfcn |= GSMTAP_ARFCN_F_UPLINK;
+
+ gsmtap_send_ex(inst, GSMTAP_TYPE_GSM_RLP, arfcn, lchan->ts->nr,
lchan->type == GSM_LCHAN_TCH_H ? GSMTAP_CHANNEL_VOICE_H : GSMTAP_CHANNEL_VOICE_F,
lchan->nr, tch_ind->fn, tch_ind->rssi, 0, rlp_buf, byte_len);


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

Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Change-Id: Ida3d684968a3e4a45531d4b6d7b6af170e3e39f4
Gerrit-Change-Number: 35468
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria <vyanitskiy@sysmocom.de>
Gerrit-MessageType: newchange