From 58342fdbe280b140907b10fe95396a8ef3e3db41 Mon Sep 17 00:00:00 2001 From: Pau Espin Pedrol Date: Mon, 31 Jul 2023 16:11:57 +0200 Subject: rlcmac: keep looking up GRE based on old TLLI This is needed after RAU Update since the PCU may still be using the old TLLI to reference the MS for a while until it finds out about the TLLI update. Change-Id: I2653db3dac58342df02a1b4d0c76e69e0e8d583f --- include/osmocom/gprs/rlcmac/gre.h | 1 + src/rlcmac/gre.c | 1 + src/rlcmac/rlcmac.c | 2 +- src/rlcmac/rlcmac_prim.c | 4 ++++ 4 files changed, 7 insertions(+), 1 deletion(-) diff --git a/include/osmocom/gprs/rlcmac/gre.h b/include/osmocom/gprs/rlcmac/gre.h index a7317cd..be36e23 100644 --- a/include/osmocom/gprs/rlcmac/gre.h +++ b/include/osmocom/gprs/rlcmac/gre.h @@ -21,6 +21,7 @@ struct gprs_rlcmac_tbf; struct gprs_rlcmac_entity { struct llist_head entry; /* item in (struct gprs_rlcmac_ctx)->gre_list */ uint32_t tlli; + uint32_t old_tlli; /* Used to match paging requests coming from CS domain: */ uint32_t ptmsi; diff --git a/src/rlcmac/gre.c b/src/rlcmac/gre.c index 0eb6a8c..9102124 100644 --- a/src/rlcmac/gre.c +++ b/src/rlcmac/gre.c @@ -66,6 +66,7 @@ struct gprs_rlcmac_entity *gprs_rlcmac_entity_alloc(uint32_t tlli) goto err_free_gre; gre->tlli = tlli; + gre->old_tlli = GPRS_RLCMAC_TLLI_UNASSIGNED; gre->ptmsi = GSM_RESERVED_TMSI; llist_add_tail(&gre->entry, &g_rlcmac_ctx->gre_list); diff --git a/src/rlcmac/rlcmac.c b/src/rlcmac/rlcmac.c index f35c04d..a6d0e71 100644 --- a/src/rlcmac/rlcmac.c +++ b/src/rlcmac/rlcmac.c @@ -137,7 +137,7 @@ struct gprs_rlcmac_entity *gprs_rlcmac_find_entity_by_tlli(uint32_t tlli) { struct gprs_rlcmac_entity *gre; llist_for_each_entry(gre, &g_rlcmac_ctx->gre_list, entry) { - if (gre->tlli == tlli) + if (gre->tlli == tlli || gre->old_tlli == tlli) return gre; } return NULL; diff --git a/src/rlcmac/rlcmac_prim.c b/src/rlcmac/rlcmac_prim.c index f13ac3d..1ce7c9e 100644 --- a/src/rlcmac/rlcmac_prim.c +++ b/src/rlcmac/rlcmac_prim.c @@ -469,6 +469,8 @@ static int rlcmac_prim_handle_gmmrr_assign_req(struct osmo_gprs_rlcmac_prim *rlc rc = -ENOENT; goto free_ret; } + gre->old_tlli = old_tlli; + gre->tlli = GPRS_RLCMAC_TLLI_UNASSIGNED; gprs_rlcmac_entity_free(gre); gre = NULL; goto free_ret; @@ -481,7 +483,9 @@ static int rlcmac_prim_handle_gmmrr_assign_req(struct osmo_gprs_rlcmac_prim *rlc goto free_ret; } LOGGRE(gre, LOGL_INFO, "Update TLLI 0x%08x -> 0x%08x\n", old_tlli, new_tlli); + gre->old_tlli = old_tlli; gre->tlli = new_tlli; + } /* cache/update knowledge about this GMME's PTMSI and IMSI. It will be -- cgit v1.2.3