aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/src/gprs/gprs_llc.c
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2010-07-01 11:54:31 +0200
committerHarald Welte <laforge@gnumonks.org>2010-07-01 11:54:31 +0200
commit875840c603defa333dd1eeced09f4b04c0af8fa8 (patch)
treef934caf80bf9e623cab34cea0a24ec44fb75236e /openbsc/src/gprs/gprs_llc.c
parent937a9ecfcd4efd4121abc31df6673f0636d4605a (diff)
[SGSN] Fix TLLI (re)assignments
Once The TLLI (or P-TMSI of which it is derived) change has been confirmed by the MS, we need to unassign the old TLLI but keep the new TLLI _without_ re-setting the LLC entity structure such as VUsend /VUrecv counters.
Diffstat (limited to 'openbsc/src/gprs/gprs_llc.c')
-rw-r--r--openbsc/src/gprs/gprs_llc.c31
1 files changed, 18 insertions, 13 deletions
diff --git a/openbsc/src/gprs/gprs_llc.c b/openbsc/src/gprs/gprs_llc.c
index f45bd325c..98193d9fd 100644
--- a/openbsc/src/gprs/gprs_llc.c
+++ b/openbsc/src/gprs/gprs_llc.c
@@ -141,6 +141,7 @@ static struct gprs_llc_llme *llme_alloc(uint32_t tlli)
return NULL;
llme->tlli = tlli;
+ llme->old_tlli = 0xffffffff;
llme->state = GPRS_LLMS_UNASSIGNED;
for (i = 0; i < ARRAY_SIZE(llme->lle); i++)
@@ -709,19 +710,23 @@ int gprs_llgmm_assign(struct gprs_llc_llme *llme,
/* If old TLLI != 0xffffffff was assigned to LLME, then TLLI
* old is unassigned. Only TLLI new shall be accepted when
* received from peer. */
-
- /* If TLLI old == 0xffffffff was assigned to LLME, then this is
- * TLLI assignmemt according to 8.3.1 */
- llme->old_tlli = 0;
- llme->tlli = new_tlli;
- llme->state = GPRS_LLMS_ASSIGNED;
- /* 8.5.3.1 For all LLE's */
- for (i = 0; i < ARRAY_SIZE(llme->lle); i++) {
- struct gprs_llc_lle *l = &llme->lle[i];
- l->vu_send = l->vu_recv = 0;
- l->retrans_ctr = 0;
- l->state = GPRS_LLES_ASSIGNED_ADM;
- /* FIXME Set parameters according to table 9 */
+ if (llme->old_tlli != 0xffffffff) {
+ llme->old_tlli = 0xffffffff;
+ llme->tlli = new_tlli;
+ } else {
+ /* If TLLI old == 0xffffffff was assigned to LLME, then this is
+ * TLLI assignmemt according to 8.3.1 */
+ llme->old_tlli = 0xffffffff;
+ llme->tlli = new_tlli;
+ llme->state = GPRS_LLMS_ASSIGNED;
+ /* 8.5.3.1 For all LLE's */
+ for (i = 0; i < ARRAY_SIZE(llme->lle); i++) {
+ struct gprs_llc_lle *l = &llme->lle[i];
+ l->vu_send = l->vu_recv = 0;
+ l->retrans_ctr = 0;
+ l->state = GPRS_LLES_ASSIGNED_ADM;
+ /* FIXME Set parameters according to table 9 */
+ }
}
} else if (old_tlli != 0xffffffff && new_tlli != 0xffffffff) {
/* TLLI Change 8.3.2 */