aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/include
diff options
context:
space:
mode:
authorJacob Erlbeck <jerlbeck@sysmocom.de>2014-10-28 12:23:29 +0100
committerHolger Hans Peter Freyther <holger@moiji-mobile.com>2014-11-14 08:57:50 +0100
commit93eae8ec78d145cf87b7858ebee60c72da7a2d20 (patch)
treec1ba9d775fa7a078a5832fc9431cf994beaef091 /openbsc/include
parent3911880b68ddd92c9dd89d6ac20c26807e33f905 (diff)
sgsn: Reorganize and fix gsm48_gmm_authorize
Currently the order of the 'if' clauses in gsm48_gmm_authorize doesn't match the order in which the conditional parts are entered. This makes it difficult to maintain. In addition the t3350_mode is not stored in every path, so that this information is lost when the identification procedure is started. Since the default value coincidentally is GMM_T3350_MODE_ATT, this doesn't hurt for Attach Requests which are the only messages that initially trigger the authentication yet. This patch changes the order of the 'if' clause to match the processing order, it removes the t3350_mode parameter entirely and introduces a mm->pending_req field. The latter must be set when the request that causes the authorization before calling gsm48_gmm_authorize. The gprs_t3350_mode enum is extended by GMM_T3350_MODE_NONE (value 0, which is the default) to make it possible to detect related initialisation errors or race conditions. Sponsored-by: On-Waves ehf
Diffstat (limited to 'openbsc/include')
-rw-r--r--openbsc/include/openbsc/gprs_sgsn.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/openbsc/include/openbsc/gprs_sgsn.h b/openbsc/include/openbsc/gprs_sgsn.h
index 73731fe97..75797dba0 100644
--- a/openbsc/include/openbsc/gprs_sgsn.h
+++ b/openbsc/include/openbsc/gprs_sgsn.h
@@ -48,6 +48,7 @@ enum gprs_pdp_ctx {
};
enum gprs_t3350_mode {
+ GMM_T3350_MODE_NONE,
GMM_T3350_MODE_ATT,
GMM_T3350_MODE_RAU,
GMM_T3350_MODE_PTMSI_REALL,
@@ -111,6 +112,11 @@ struct sgsn_mm_ctx {
enum gprs_t3350_mode t3350_mode;
uint8_t t3370_id_type;
+ uint8_t pending_req; /* the request's message type */
+ /* TODO: There isn't much semantic difference between t3350_mode
+ * (refers to the timer) and pending_req (refers to the procedure),
+ * where mm->T == 3350 => mm->t3350_mode == f(mm->pending_req). Check
+ * whether one of them can be dropped. */
};
#define LOGMMCTXP(level, mm, fmt, args...) \