create_context_ind(): ignore a non-started default APN
If the default APN has not been started, it is not eligible to be
used in starting of new PDP contexts.
Change-Id: I93b5c205c033f275824ee8bc8cdcf1428fb086df
diff --git a/ggsn/ggsn.c b/ggsn/ggsn.c
index f8aec9d..5852ef6 100644
--- a/ggsn/ggsn.c
+++ b/ggsn/ggsn.c
@@ -451,9 +451,14 @@
/* ignore if the APN has not been started */
if (!apn->started)
apn = NULL;
+
/* then try default (if any) */
if (!apn)
apn = ggsn->cfg.default_apn;
+ /* ignore if the APN has not been started */
+ if (!apn->started)
+ apn = NULL;
+
if (!apn) {
/* no APN found for what user requested */
LOGPPDP(LOGL_NOTICE, pdp, "Unknown APN '%s', rejecting\n", name_buf);