aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJacob Erlbeck <jerlbeck@sysmocom.de>2015-06-11 11:47:06 +0200
committerJacob Erlbeck <jerlbeck@sysmocom.de>2015-06-11 13:13:55 +0200
commitd0aee85b29a17e6ef3fb1454a798e10ced0d0266 (patch)
tree2dba2b7fac651e6dcccbd86994191a4c7852ae87
parent09fdf6622a3774849bc90b9c4fedf76fdc76ac03 (diff)
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
-rw-r--r--src/llc.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/llc.cpp b/src/llc.cpp
index 09242a55..d847c872 100644
--- a/src/llc.cpp
+++ b/src/llc.cpp
@@ -89,8 +89,8 @@ bool gprs_llc::is_user_data_frame(uint8_t *data, size_t len)
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;