From d0aee85b29a17e6ef3fb1454a798e10ced0d0266 Mon Sep 17 00:00:00 2001 From: Jacob Erlbeck Date: Thu, 11 Jun 2015 11:47:06 +0200 Subject: [PATCH] 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 --- src/llc.cpp | 4 ++-- 1 file 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;