From 3898cd684337867bc7724fd8ef6e949b7f65e4a1 Mon Sep 17 00:00:00 2001 From: Vadim Yanitskiy Date: Sat, 25 Jan 2020 04:43:15 +0700 Subject: [PATCH] gprs_bssgp_pcu: fix invalid use of non-static data member 'frame' The 'gprs_llc' is defined as a pure C structure with C++ specific extensions (methods), so it's rather a class. Accessing its field 'frame' statically causes Clang to throw a compilation error: gprs_bssgp_pcu.cpp:111:29: error: invalid use of non-static data member 'frame' if (len > sizeof(gprs_llc::frame)) Let's avoid this and use LLC_MAX_LEN as the size limitation. God knows what to expect from such a mix of C++ and C... Change-Id: I7f84bd776cc780a45880f136107f6e0bc56241d1 --- src/gprs_bssgp_pcu.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gprs_bssgp_pcu.cpp b/src/gprs_bssgp_pcu.cpp index f00fc944..080245a7 100644 --- a/src/gprs_bssgp_pcu.cpp +++ b/src/gprs_bssgp_pcu.cpp @@ -108,7 +108,7 @@ static int gprs_bssgp_pcu_rx_dl_ud(struct msgb *msg, struct tlv_parsed *tp) data = (uint8_t *) TLVP_VAL(tp, BSSGP_IE_LLC_PDU); len = TLVP_LEN(tp, BSSGP_IE_LLC_PDU); - if (len > sizeof(gprs_llc::frame)) + if (len > sizeof(LLC_MAX_LEN)) { LOGP(DBSSGP, LOGL_NOTICE, "BSSGP TLLI=0x%08x Rx UL-UD IE_LLC_PDU too large\n", tlli); return bssgp_tx_status(BSSGP_CAUSE_COND_IE_ERR, NULL, msg);