sgsn: Be more tolerant with state and SUSPEND/RESUME

Currently, when a BSSGP SUSPEND is received and the corresponding MM
context is already in the state GMM_REGISTERED_SUSPENDED, a
SUSPEND_NACK is returned which is not covered by GSM 08.18, 7.4.1.
The same goes for RESUME in the state GMM_REGISTERED_NORMAL.

This commit changes gprs_gmm_rx_suspend and gprs_gmm_rx_resume to not
complain (and thus answer a NACK) when the MM context is either in
GMM_REGISTERED_SUSPENDED or GMM_REGISTERED_NORMAL.

Note that GSM 08.18, 7.4.1 and 7.5.1 only mention to send an NACK if
the MS is not known. Even with this patch, the SGSN returns a NACK if
either the MS is unknown _or_ the MM context ist not in one of the
state GMM_REGISTERED_SUSPENDED and GMM_REGISTERED_NORMAL.

Sponsored-by: On-Waves ehf
This commit is contained in:
Jacob Erlbeck 2014-12-22 17:58:18 +01:00 committed by Holger Hans Peter Freyther
parent 3ea2260d00
commit 7dba11fe32
1 changed files with 4 additions and 2 deletions

View File

@ -1952,7 +1952,8 @@ int gprs_gmm_rx_suspend(struct gprs_ra_id *raid, uint32_t tlli)
return -EINVAL;
}
if (mmctx->mm_state != GMM_REGISTERED_NORMAL) {
if (mmctx->mm_state != GMM_REGISTERED_NORMAL &&
mmctx->mm_state != GMM_REGISTERED_SUSPENDED) {
LOGMMCTXP(LOGL_NOTICE, mmctx, "SUSPEND request while state "
"!= REGISTERED (TLLI=%08x)\n", tlli);
return -EINVAL;
@ -1977,7 +1978,8 @@ int gprs_gmm_rx_resume(struct gprs_ra_id *raid, uint32_t tlli,
return -EINVAL;
}
if (mmctx->mm_state != GMM_REGISTERED_SUSPENDED) {
if (mmctx->mm_state != GMM_REGISTERED_NORMAL &&
mmctx->mm_state != GMM_REGISTERED_SUSPENDED) {
LOGMMCTXP(LOGL_NOTICE, mmctx, "RESUME request while state "
"!= SUSPENDED (TLLI=%08x)\n", tlli);
/* FIXME: should we not simply ignore it? */