bts: refuse to set invalid frame numbers
A valid GSM frame ranges from 0 to 2715647. When using
set_current_frame_number() to set the current frame number (source
usually is the layer 1 and below) we should not allow invalid frame
numbers.
Note: this also fixes FnTest which uses invalid frame numbers for
testsing.
Change-Id: Iaae31b370fababba975d419b0d20ac15618c296e
Related: OS#5198
diff --git a/src/bts.cpp b/src/bts.cpp
index cf39aa4..650d4a3 100644
--- a/src/bts.cpp
+++ b/src/bts.cpp
@@ -338,6 +338,9 @@
void bts_set_current_frame_number(struct gprs_rlcmac_bts *bts, uint32_t fn)
{
+ /* See also 3GPP TS 45.002, section 4.3.3 */
+ OSMO_ASSERT(fn < GSM_TDMA_HYPERFRAME);
+
/* The UL frame numbers lag 3 behind the DL frames and the data
* indication is only sent after all 4 frames of the block have been
* received. Sometimes there is an idle frame between the end of one