llc: Fix LLC UI frame detection (Coverity)
Currently the wrong nibble is masked out, so the conditional
expression always yields true.
Therefore gprs_llc::is_user_data_frame() always returns true. As a
consequence, the low watermark feature of
gprs_rlcmac_dl_tbf::llc_dequeue() is not being used in fact.
This commit fixes the mask value.
Fixes: Coverity CID 1292834, 1292835
Sponsored-by: On-Waves ehf
diff --git a/src/llc.cpp b/src/llc.cpp
index 09242a5..d847c87 100644
--- a/src/llc.cpp
+++ b/src/llc.cpp
@@ -89,8 +89,8 @@
if ((data[0] & 0x0f) == 1 /* GPRS_SAPI_GMM */)
return false;
- if ((data[0] & 0x0e) != 0xc0 /* LLC UI */)
- /* It is not an LLC UI frame */
+ if ((data[0] & 0xe0) != 0xc0 /* LLC UI */)
+ /* It is not an LLC UI frame, see TS 44.064, 6.3 */
return false;
return true;