aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/src/gprs
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2010-07-02 15:45:12 +0200
committerHarald Welte <laforge@gnumonks.org>2010-07-02 15:45:12 +0200
commit60da7d4f886d4c4fac52ac5ae1c6ba16257a643c (patch)
tree8954d99d9fbd0675083c97d93d8ce5e82f432029 /openbsc/src/gprs
parent8f0c0a3a3cf161d627c6ca3f055619da91526b76 (diff)
[SGSN] SNDCP defrag: use correct length, don't include LLC FCS
The LLC layer tells us the PDU length, and we have to use it in SNDCP rather than to re-calculate it if we want to avoid copying the CRC24 into the defrag elements.
Diffstat (limited to 'openbsc/src/gprs')
-rw-r--r--openbsc/src/gprs/gprs_sndcp.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/openbsc/src/gprs/gprs_sndcp.c b/openbsc/src/gprs/gprs_sndcp.c
index 8ca919469..9c13fbde0 100644
--- a/openbsc/src/gprs/gprs_sndcp.c
+++ b/openbsc/src/gprs/gprs_sndcp.c
@@ -176,7 +176,8 @@ static int defrag_segments(struct gprs_sndcp_entity *sne)
sne->nsapi, msg, sne->defrag.tot_len, npdu);
}
-static int defrag_input(struct gprs_sndcp_entity *sne, struct msgb *msg, uint8_t *hdr)
+static int defrag_input(struct gprs_sndcp_entity *sne, struct msgb *msg, uint8_t *hdr,
+ unsigned int len)
{
struct sndcp_common_hdr *sch;
struct sndcp_comp_hdr *scomph = NULL;
@@ -227,7 +228,7 @@ static int defrag_input(struct gprs_sndcp_entity *sne, struct msgb *msg, uint8_t
}
/* FIXME: check if seg_nr already exists */
- rc = defrag_enqueue(sne, suh->seg_nr, (msg->data + msg->len) - data, data);
+ rc = defrag_enqueue(sne, suh->seg_nr, len, data);
if (rc < 0)
return rc;
@@ -534,7 +535,7 @@ int sndcp_llunitdata_ind(struct msgb *msg, struct gprs_llc_lle *lle, uint8_t *hd
LOGP(DSNDCP, LOGL_ERROR, "We don't support reassembly yet\n");
return -EIO;
#else
- return defrag_input(sne, msg, hdr);
+ return defrag_input(sne, msg, hdr, len);
#endif
}