aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/gprs/gprs_llc.c4
-rw-r--r--src/gprs/gprs_sndcp.c2
2 files changed, 4 insertions, 2 deletions
diff --git a/src/gprs/gprs_llc.c b/src/gprs/gprs_llc.c
index 6c92f8334..abbb74278 100644
--- a/src/gprs/gprs_llc.c
+++ b/src/gprs/gprs_llc.c
@@ -945,6 +945,9 @@ int gprs_llc_rcvmsg(struct msgb *msg, struct tlv_parsed *tv)
LOGP(DLLC, LOGL_INFO, "Dropping frame with invalid FCS\n");
return -EIO;
}
+ /* set l3 layer & remove the fcs */
+ msg->l3h = llhp.data;
+ msgb_l3trim(msg, llhp.data_len);
/* Update LLE's (BVCI, NSEI) tuple */
lle->llme->bvci = msgb_bvci(msg);
@@ -960,7 +963,6 @@ int gprs_llc_rcvmsg(struct msgb *msg, struct tlv_parsed *tv)
/* llhp.data is only set when we need to send LL_[UNIT]DATA_IND up */
if (llhp.cmd == GPRS_LLC_UI && llhp.data && llhp.data_len) {
- msgb_gmmh(msg) = llhp.data;
switch (llhp.sapi) {
case GPRS_SAPI_GMM:
/* send LL_UNITDATA_IND to GMM */
diff --git a/src/gprs/gprs_sndcp.c b/src/gprs/gprs_sndcp.c
index 77f8ca663..52eeb75d5 100644
--- a/src/gprs/gprs_sndcp.c
+++ b/src/gprs/gprs_sndcp.c
@@ -792,7 +792,7 @@ int sndcp_llunitdata_ind(struct msgb *msg, struct gprs_llc_lle *lle,
npdu_num = (suh->npdu_high << 8) | suh->npdu_low;
npdu = (uint8_t *)suh + sizeof(*suh);
- npdu_len = (msg->data + msg->len) - npdu - 3; /* -3 'removes' the FCS */
+ npdu_len = (msg->data + msg->len) - npdu;
if (npdu_len <= 0) {
LOGP(DSNDCP, LOGL_ERROR, "Short SNDCP N-PDU: %d\n", npdu_len);