aboutsummaryrefslogtreecommitdiffstats
path: root/src/osmo-bts-trx/trx_if.c
diff options
context:
space:
mode:
authorVadim Yanitskiy <vyanitskiy@sysmocom.de>2021-04-17 04:05:36 +0200
committerlaforge <laforge@osmocom.org>2021-04-24 08:47:00 +0000
commit17350e2fd6a842a9d0ad78178eece0945dc394ce (patch)
tree4d91f7c42f0c5a858d8ad568703738954ad57193 /src/osmo-bts-trx/trx_if.c
parent974bf725a4f88578dca79b67fb983d2058f2ae1d (diff)
osmo-bts-trx: move TDMA frame number check to trx_data_read_cb()
Diffstat (limited to 'src/osmo-bts-trx/trx_if.c')
-rw-r--r--src/osmo-bts-trx/trx_if.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/osmo-bts-trx/trx_if.c b/src/osmo-bts-trx/trx_if.c
index 5ce18891..5d18c2c7 100644
--- a/src/osmo-bts-trx/trx_if.c
+++ b/src/osmo-bts-trx/trx_if.c
@@ -743,12 +743,6 @@ static int trx_data_handle_hdr_v0(struct trx_l1h *l1h,
bi->rssi = -(int8_t)buf[5];
bi->toa256 = (int16_t) osmo_load16be(buf + 6);
- if (bi->fn >= GSM_TDMA_HYPERFRAME) {
- LOGPPHI(l1h->phy_inst, DTRX, LOGL_ERROR,
- "Illegal TDMA fn=%u\n", bi->fn);
- return -EINVAL;
- }
-
return TRX_UL_V0HDR_LEN;
}
@@ -974,6 +968,13 @@ static int trx_data_read_cb(struct osmo_fd *ofd, unsigned int what)
if (hdr_len < 0)
return hdr_len;
+ if (bi.fn >= GSM_TDMA_HYPERFRAME) {
+ LOGPPHI(l1h->phy_inst, DTRX, LOGL_ERROR,
+ "Rx malformed TRXDv%u PDU: illegal TDMA fn=%u\n",
+ pdu_ver, bi.fn);
+ return -EINVAL;
+ }
+
if (bi.flags & TRX_BI_F_NOPE_IND) {
bi.burst_len = 0;
goto skip_burst;