aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <holger@moiji-mobile.com>2015-05-25 14:35:10 +0800
committerHolger Hans Peter Freyther <holger@moiji-mobile.com>2015-05-25 14:38:01 +0800
commit08bb84b04e15c97739b9c11b2f26407ee663bc24 (patch)
tree13948bb6b8d0032b815604f4c7a9f59185634c15
parent9270d99f3db58e70d50ad45644b039b3fa314574 (diff)
sgsn: Deal with no static ggsn being configured at all
In case no static ggsn is configured the code would crash with the assumption that there is always such a GGSN.
-rw-r--r--openbsc/src/gprs/gprs_sgsn.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/openbsc/src/gprs/gprs_sgsn.c b/openbsc/src/gprs/gprs_sgsn.c
index ad90d3c16..3c25840ef 100644
--- a/openbsc/src/gprs/gprs_sgsn.c
+++ b/openbsc/src/gprs/gprs_sgsn.c
@@ -716,6 +716,13 @@ struct sgsn_ggsn_ctx *sgsn_mm_ctx_find_ggsn_ctx(struct sgsn_mm_ctx *mmctx,
return NULL;
}
+ if (!ggsn) {
+ LOGMMCTXP(LOGL_NOTICE, mmctx,
+ "No static GGSN configured. Selected APN '%s'\n",
+ selected_apn_str);
+ return NULL;
+ }
+
LOGMMCTXP(LOGL_INFO, mmctx,
"Found GGSN %d for APN '%s' (requested '%s')\n",
ggsn->id, selected_apn_str ? selected_apn_str : "---",