aboutsummaryrefslogtreecommitdiffstats
path: root/Transceiver52M
diff options
context:
space:
mode:
authorThomas Tsou <tom@tsou.cc>2013-11-14 15:28:23 -0500
committerThomas Tsou <tom@tsou.cc>2013-11-15 23:35:07 -0500
commit2d0c00bd3d8f52690aeb86001cb4a268fed59463 (patch)
treeadbe7398378fe18b7088f223f0553e072207994b /Transceiver52M
parente90a42becce19e9adcbf648d34fec5332cebc5ba (diff)
Transceiver52M: Check time slot validity of incoming bursts
In errant cases, GSM core may send bursts with invalid slot values, which is allowed by the GSM::Time object. If we find a burst like this coming into the transceiver, then drop it immediately. Signed-off-by: Thomas Tsou <tom@tsou.cc>
Diffstat (limited to 'Transceiver52M')
-rw-r--r--Transceiver52M/Transceiver.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/Transceiver52M/Transceiver.cpp b/Transceiver52M/Transceiver.cpp
index eae4e06..33d22ad 100644
--- a/Transceiver52M/Transceiver.cpp
+++ b/Transceiver52M/Transceiver.cpp
@@ -176,6 +176,11 @@ void Transceiver::addRadioVector(size_t chan, BitVector &bits,
return;
}
+ if (wTime.TN() > 7) {
+ LOG(ALERT) << "Received burst with invalid slot " << wTime.TN();
+ return;
+ }
+
burst = modulateBurst(bits, 8 + (wTime.TN() % 4 == 0), mSPSTx);
scaleVector(*burst, txFullScale * pow(10, -RSSI / 10));