diff options
author | Jacob Erlbeck <jerlbeck@sysmocom.de> | 2014-10-31 12:20:49 +0100 |
---|---|---|
committer | Holger Hans Peter Freyther <holger@moiji-mobile.com> | 2014-11-14 09:23:38 +0100 |
commit | abdf02b9b988a816201b4530f36f709ca4c146ac (patch) | |
tree | dcdbadef88738162fea5bdd033e922b3ae561219 /openbsc/src/gprs/gprs_gmm.c | |
parent | a790456f1b826ea204f47c4aa4973dc777d00d2a (diff) |
sgsn: Split gsm0408_gprs_force_reattach into 2 functions
This patch replaces gsm0408_gprs_force_reattach(msg, mmctx) by two
functions
- gsm0408_gprs_force_reattach(mmctx)
- gsm0408_gprs_force_reattach_oldmsg(msg)
The old function basically consists of the code of the two new
functions, where the code path selected depends on mmctx == NULL,
which is harder to maintain, less obvious to use, and not consistent
with many other SGSN functions.
Sponsored-by: On-Waves ehf
Diffstat (limited to 'openbsc/src/gprs/gprs_gmm.c')
-rw-r--r-- | openbsc/src/gprs/gprs_gmm.c | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/openbsc/src/gprs/gprs_gmm.c b/openbsc/src/gprs/gprs_gmm.c index 389123d05..711981680 100644 --- a/openbsc/src/gprs/gprs_gmm.c +++ b/openbsc/src/gprs/gprs_gmm.c @@ -1689,16 +1689,21 @@ static int gsm0408_rcv_gsm(struct sgsn_mm_ctx *mmctx, struct msgb *msg, return rc; } -int gsm0408_gprs_force_reattach(struct msgb *msg, struct sgsn_mm_ctx *mmctx) +int gsm0408_gprs_force_reattach_oldmsg(struct msgb *msg) { + int rc; gprs_llgmm_reset_oldmsg(msg, GPRS_SAPI_GMM); - if (!mmctx) - return gsm48_tx_gmm_detach_req_oldmsg( - msg, GPRS_DET_T_MT_REATT_REQ, GMM_CAUSE_IMPL_DETACHED); + rc = gsm48_tx_gmm_detach_req_oldmsg( + msg, GPRS_DET_T_MT_REATT_REQ, GMM_CAUSE_IMPL_DETACHED); + + return rc; +} - /* Mark MM state as deregistered initiated */ - mmctx->mm_state = GMM_DEREGISTERED_INIT; +int gsm0408_gprs_force_reattach(struct sgsn_mm_ctx *mmctx) +{ + int rc; + gprs_llgmm_reset(mmctx->llme); /* Delete all existing PDP contexts for this MS */ delete_pdp_contexts(mmctx, "forced reattach"); |