Attention is currently required from: pespin, dexter. fixeria has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-pcu/+/30863 )
Change subject: bts: refuse to set invalid frame numbers ......................................................................
Patch Set 1: Code-Review-1
(2 comments)
Patchset:
PS1:
I meant osmo_panic() actually.
IMO, OSMO_ASSERT() would be enough as it gives enough context.
File src/bts.cpp:
https://gerrit.osmocom.org/c/osmo-pcu/+/30863/comment/c867a6de_0be6cd00 PS1, Line 342: fn > GSM_TDMA_HYPERFRAME According to 3GPP TS 45.002, section 4.3.3: "The frame number shall be cyclic and shall have a range of 0 to FN_MAX where FN_MAX = (26 x 51 x 2048) -1 = 2715647 as defined in 3GPP TS 45.010".
GSM_TDMA_HYPERFRAME = (26 x 51 x 2048) = 2715648, without the -1, so it's not a valid TDMA Fn value. Your condition is not entirely correct, because it permits this value. Simply do OSMO_ASSERT(fn < GSM_TDMA_HYPERFRAME).