aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Couzens <lynxis@fe80.eu>2019-08-13 11:31:42 +0200
committerlaforge <laforge@gnumonks.org>2019-09-02 08:59:43 +0000
commit4ec21769b2e0779894895ef3942d3a5237b9f1a7 (patch)
tree173125b987b65724581f616937b2b0a11a1fc704
parentc44af53d1e4c56de41b53ee13a5a72b440640e52 (diff)
gprs_gmm: gsm48_rx_gmm_att_req(): refactor duplicated code
-rw-r--r--src/gprs/gprs_gmm.c16
1 files changed, 6 insertions, 10 deletions
diff --git a/src/gprs/gprs_gmm.c b/src/gprs/gprs_gmm.c
index 185cd9ad..00335e8a 100644
--- a/src/gprs/gprs_gmm.c
+++ b/src/gprs/gprs_gmm.c
@@ -1460,11 +1460,6 @@ static int gsm48_rx_gmm_att_req(struct sgsn_mm_ctx *ctx, struct msgb *msg,
}
osmo_strlcpy(ctx->imsi, mi_string, sizeof(ctx->imsi));
}
- if (ctx->ran_type == MM_CTX_T_GERAN_Gb) {
- ctx->gb.tlli = msgb_tlli(msg);
- ctx->gb.llme = llme;
- }
- msgid2mmctx(ctx, msg);
break;
case GSM_MI_TYPE_TMSI:
memcpy(&tmsi, mi+1, 4);
@@ -1485,11 +1480,6 @@ static int gsm48_rx_gmm_att_req(struct sgsn_mm_ctx *ctx, struct msgb *msg,
}
ctx->p_tmsi = tmsi;
}
- if (ctx->ran_type == MM_CTX_T_GERAN_Gb) {
- ctx->gb.tlli = msgb_tlli(msg);
- ctx->gb.llme = llme;
- }
- msgid2mmctx(ctx, msg);
break;
default:
LOGMMCTXP(LOGL_NOTICE, ctx, "Rejecting ATTACH REQUEST with "
@@ -1497,6 +1487,12 @@ static int gsm48_rx_gmm_att_req(struct sgsn_mm_ctx *ctx, struct msgb *msg,
reject_cause = GMM_CAUSE_MS_ID_NOT_DERIVED;
goto rejected;
}
+
+ if (ctx->ran_type == MM_CTX_T_GERAN_Gb) {
+ ctx->gb.tlli = msgb_tlli(msg);
+ ctx->gb.llme = llme;
+ }
+ msgid2mmctx(ctx, msg);
/* Update MM Context with currient RA and Cell ID */
ctx->ra = ra_id;
if (ctx->ran_type == MM_CTX_T_GERAN_Gb)