aboutsummaryrefslogtreecommitdiffstats
path: root/src/gprs/sgsn_libgtp.c
diff options
context:
space:
mode:
authorJonathan Santos <jrsantos@jonathanrsantos.com>2011-06-10 17:07:45 -0400
committerJonathan Santos <jrsantos@jonathanrsantos.com>2011-06-23 17:45:19 -0400
commit8f3a5a2f0bbcd94e122639c45a9f7f0e73c46865 (patch)
tree3c5fa716efa0b7728b767536431368c641d3693c /src/gprs/sgsn_libgtp.c
parent749a666d849743353473813210cbf6899005c6c4 (diff)
gprs: Delete GMM and PDP contexts if ATTACH_REQUEST received from already-attached MS
TS 24.008 version 9.5.0 Release 9 sec 4.7.3.1.6: If an ATTACH REQUEST message is received in state GMM-REGISTERED the network may initiate the GMM common procedures; if it turned out that the ATTACH REQUEST message was send by an MS that has already been attached, the GMM context, PDP contexts and MBMS contexts, if any, are deleted and the new ATTACH REQUEST is progressed.
Diffstat (limited to 'src/gprs/sgsn_libgtp.c')
-rw-r--r--src/gprs/sgsn_libgtp.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/src/gprs/sgsn_libgtp.c b/src/gprs/sgsn_libgtp.c
index 7b10a45a3..b2d8874ac 100644
--- a/src/gprs/sgsn_libgtp.c
+++ b/src/gprs/sgsn_libgtp.c
@@ -208,12 +208,20 @@ struct sgsn_pdp_ctx *sgsn_create_pdp_ctx(struct sgsn_ggsn_ctx *ggsn,
}
/* SGSN wants to delete a PDP context */
-int sgsn_delete_pdp_ctx(struct sgsn_pdp_ctx *pctx)
+int sgsn_delete_pdp_ctx(struct sgsn_pdp_ctx *pctx, int implicit)
{
LOGP(DGPRS, LOGL_ERROR, "Delete PDP Context\n");
+ if (implicit != 0) {
+ /* Deactivate the SNDCP layer */
+ sndcp_sm_deactivate_ind(&pctx->mm->llme->lle[pctx->sapi], pctx->nsapi);
+ }
+
/* FIXME: decide if we need teardown or not ! */
- return gtp_delete_context_req(pctx->ggsn->gsn, pctx->lib, pctx, 1);
+ return gtp_delete_context_req(pctx->ggsn->gsn,
+ pctx->lib,
+ implicit == 0 ? pctx : NULL,
+ 1);
}
struct cause_map {
@@ -312,6 +320,10 @@ static int delete_pdp_conf(struct pdp_t *pdp, void *cbp, int cause)
DEBUGP(DGPRS, "Received DELETE PDP CTX CONF, cause=%d(%s)\n",
cause, get_value_string(gtp_cause_strs, cause));
+ if (!pctx) {
+ return 0;
+ }
+
/* Deactivate the SNDCP layer */
sndcp_sm_deactivate_ind(&pctx->mm->llme->lle[pctx->sapi], pctx->nsapi);