aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/src/gprs/gprs_llc.c
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2010-12-26 10:39:26 +0100
committerHarald Welte <laforge@gnumonks.org>2011-01-01 17:28:29 +0100
commitf0901f0067e363c0ced6254db1b45a9771640412 (patch)
treebc0222cf1438c15a6d9cc43199d79293afa6dec9 /openbsc/src/gprs/gprs_llc.c
parent91c59c8cb5afe2d8eba194d5dd1de19323b71878 (diff)
[SGSN] Fix processing of RA Update Request regarding TLLI
In case we get a RA UPD REQ on a new cell (both served by the same SGSN), the LLC stack should not allocate a ne LLE/LLME, as the latter would reset the V(u)sent / V(u)recv to zero and make the MS discard our responses. Instead, whenever the LLC stack sees a foreign TLLI, it should always convert it to the local TLLI before doing any lookup for a LLE/LLME.
Diffstat (limited to 'openbsc/src/gprs/gprs_llc.c')
-rw-r--r--openbsc/src/gprs/gprs_llc.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/openbsc/src/gprs/gprs_llc.c b/openbsc/src/gprs/gprs_llc.c
index 002742bee..7991f4c1e 100644
--- a/openbsc/src/gprs/gprs_llc.c
+++ b/openbsc/src/gprs/gprs_llc.c
@@ -106,11 +106,28 @@ static const struct gprs_llc_params llc_default_params[] = {
LLIST_HEAD(gprs_llc_llmes);
void *llc_tall_ctx;
+/* If the TLLI is foreign, return its local version */
+static inline uint32_t tlli_foreign2local(uint32_t tlli)
+{
+ uint32_t new_tlli;
+
+ if (gprs_tlli_type(tlli) == TLLI_FOREIGN) {
+ new_tlli = tlli | 0x40000000;
+ DEBUGP(DLLC, "TLLI 0x%08x is foreign, converting to "
+ "local TLLI 0x%08x\n", tlli, new_tlli);
+ } else
+ new_tlli = tlli;
+
+ return new_tlli;
+}
+
/* lookup LLC Entity based on DLCI (TLLI+SAPI tuple) */
static struct gprs_llc_lle *lle_by_tlli_sapi(uint32_t tlli, uint8_t sapi)
{
struct gprs_llc_llme *llme;
+ tlli = tlli_foreign2local(tlli);
+
llist_for_each_entry(llme, &gprs_llc_llmes, list) {
if (llme->tlli == tlli || llme->old_tlli == tlli)
return &llme->lle[sapi];
@@ -321,6 +338,8 @@ int gprs_llc_tx_ui(struct msgb *msg, uint8_t sapi, int command,
lle = lle_by_tlli_sapi(msgb_tlli(msg), sapi);
if (!lle) {
struct gprs_llc_llme *llme;
+ LOGP(DLLC, LOGL_ERROR, "LLC TX: unknown TLLI 0x%08x, "
+ "creating LLME on the fly\n", msgb_tlli(msg));
llme = llme_alloc(msgb_tlli(msg));
lle = &llme->lle[sapi];
}
@@ -677,6 +696,8 @@ int gprs_llc_rcvmsg(struct msgb *msg, struct tlv_parsed *tv)
struct gprs_llc_llme *llme;
/* FIXME: don't use the TLLI but the 0xFFFF unassigned? */
llme = llme_alloc(msgb_tlli(msg));
+ LOGP(DLLC, LOGL_DEBUG, "LLC RX: unknown TLLI 0x08x, "
+ "creating LLME on the fly\n", msgb_tlli(msg));
lle = &llme->lle[llhp.sapi];
} else {
LOGP(DLLC, LOGL_NOTICE,