[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.
This commit is contained in:
Harald Welte 2010-07-02 15:45:12 +02:00
parent 8f0c0a3a3c
commit 60da7d4f88
1 changed files with 4 additions and 3 deletions

View File

@ -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
}