diff options
author | Harald Welte <laforge@gnumonks.org> | 2010-05-18 19:58:38 +0200 |
---|---|---|
committer | Harald Welte <laforge@gnumonks.org> | 2010-05-18 19:58:38 +0200 |
commit | ab1d5626ace2adfb44ab2534098efa0076604b21 (patch) | |
tree | 02f4960b5f9a07cecd0af4521fd6089e63fa907c /openbsc/src/gprs/gprs_sgsn.c | |
parent | 119c2baaa6039d48a0719bbf9a30ea8908eb73b8 (diff) |
[GPRS] SGSN: use GGSN IP address from config file, disable TMSI allocation
Diffstat (limited to 'openbsc/src/gprs/gprs_sgsn.c')
-rw-r--r-- | openbsc/src/gprs/gprs_sgsn.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/openbsc/src/gprs/gprs_sgsn.c b/openbsc/src/gprs/gprs_sgsn.c index dfc05658e..0e87e62e0 100644 --- a/openbsc/src/gprs/gprs_sgsn.c +++ b/openbsc/src/gprs/gprs_sgsn.c @@ -31,6 +31,9 @@ #include <openbsc/gprs_sgsn.h> #include <openbsc/gprs_ns.h> #include <openbsc/gprs_bssgp.h> +#include <openbsc/sgsn.h> + +extern struct sgsn_instance *sgsn; LLIST_HEAD(sgsn_mm_ctxts); LLIST_HEAD(sgsn_ggsn_ctxts); @@ -70,12 +73,24 @@ struct sgsn_mm_ctx *sgsn_mm_ctx_by_tlli(uint32_t tlli, const struct gprs_ra_id *raid) { struct sgsn_mm_ctx *ctx; + int tlli_type; llist_for_each_entry(ctx, &sgsn_mm_ctxts, list) { if (tlli == ctx->tlli && ra_id_equals(raid, &ctx->ra)) return ctx; } + + tlli_type = gprs_tlli_type(tlli); + if (tlli_type == TLLI_LOCAL) { + llist_for_each_entry(ctx, &sgsn_mm_ctxts, list) { + if ((ctx->p_tmsi | 0xC0000000) == tlli) { + ctx->tlli = tlli; + return ctx; + } + } + } + return NULL; } @@ -189,6 +204,8 @@ struct sgsn_ggsn_ctx *sgsn_ggsn_ctx_alloc(uint32_t id) ggc->id = id; ggc->gtp_version = 1; + /* if we are called from config file parse, this gsn doesn't exist yet */ + ggc->gsn = sgsn->gsn; llist_add(&ggc->list, &sgsn_ggsn_ctxts); return ggc; |