diff options
author | Vadim Yanitskiy <vyanitskiy@sysmocom.de> | 2023-12-30 23:25:07 +0700 |
---|---|---|
committer | laforge <laforge@osmocom.org> | 2024-01-06 16:40:13 +0000 |
commit | 950ed8bc4da8193ba3646050ffb10680e4bb362b (patch) | |
tree | 1407f463c31ad20dda1f8f4b04b875f14fde1960 | |
parent | 59c641d20e7eb375aac6c138d1c810832a03b35f (diff) |
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
-rw-r--r-- | src/common/l1sap.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/common/l1sap.c b/src/common/l1sap.c index e9095deb..11f5e3f9 100644 --- a/src/common/l1sap.c +++ b/src/common/l1sap.c @@ -1858,6 +1858,7 @@ static void gsmtap_csd_rlp_process(struct gsm_lchan *lchan, bool is_uplink, 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 @@ static void gsmtap_csd_rlp_process(struct gsm_lchan *lchan, bool is_uplink, 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); |