diff options
author | Harald Welte <laforge@gnumonks.org> | 2010-06-03 07:14:59 +0200 |
---|---|---|
committer | Harald Welte <laforge@gnumonks.org> | 2010-06-03 07:16:04 +0200 |
commit | db2c39f888fb6c3fb69d1251cd83f6ef171dfb95 (patch) | |
tree | da7293af53a5a54dfe8d7ec4e35921a6192c8c39 /openbsc/src/gprs/gprs_sndcp.c | |
parent | 1d9d944310cb5148c028b518d330e7678b2a64c2 (diff) |
[GPRS] SNDCP: Check if SN-PDU is too large and reject it
... since we don't do fragmentation yet
Diffstat (limited to 'openbsc/src/gprs/gprs_sndcp.c')
-rw-r--r-- | openbsc/src/gprs/gprs_sndcp.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/openbsc/src/gprs/gprs_sndcp.c b/openbsc/src/gprs/gprs_sndcp.c index 600802511..72962dc22 100644 --- a/openbsc/src/gprs/gprs_sndcp.c +++ b/openbsc/src/gprs/gprs_sndcp.c @@ -172,6 +172,7 @@ int sndcp_sm_activate_ind(struct gprs_llc_lle *lle, uint8_t nsapi) return 0; } +/* Request transmission of a SN-PDU over specified LLC Entity + SAPI */ int sndcp_unitdata_req(struct msgb *msg, struct gprs_llc_lle *lle, uint8_t nsapi, void *mmcontext) { @@ -181,6 +182,13 @@ int sndcp_unitdata_req(struct msgb *msg, struct gprs_llc_lle *lle, uint8_t nsapi /* Identifiers from UP: (TLLI, SAPI) + (BVCI, NSEI) */ + if (msg->len > lle->params.n201_u - (sizeof(*sch) + sizeof(*suh))) { + LOGP(DSNDCP, LOGL_ERROR, "Message length %u > N201-U (%u): " + "SNDCP Fragmentation not yet implemented\n", + msg->len, lle->params.n201_u); + return -EIO; + } + sne = sndcp_entity_by_lle(lle, nsapi); if (!sne) { LOGP(DSNDCP, LOGL_ERROR, "Cannot find SNDCP Entity\n"); |