From dd266066c7cc96c797034da352cc9d72177c5780 Mon Sep 17 00:00:00 2001 From: Harald Welte Date: Sun, 1 Oct 2017 13:35:03 +0800 Subject: apn_start(): fix clean-up after errors bringing up APN When there's an interim error (e.g. in resolving the link-local address or setting up the tun device), apn_start() simply calls apn_stop() on the not-yet-fully-started apn_ctx. This only works if apn_stop() doesn't bail out early in case of a not-started apn_ctx, so let's remove the related check at the start of the function. Change-Id: I2917a6258cb73cc12fd9d81296ff0eaa616890b9 --- ggsn/ggsn.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/ggsn/ggsn.c b/ggsn/ggsn.c index 462b395..c1f0c1a 100644 --- a/ggsn/ggsn.c +++ b/ggsn/ggsn.c @@ -112,9 +112,6 @@ static void pool_close_all_pdp(struct ippool_t *pool) int apn_stop(struct apn_ctx *apn, bool force) { - if (!apn->started) - return 0; - LOGPAPN(LOGL_NOTICE, apn, "%sStopping\n", force ? "FORCED " : ""); /* check if pools have any active PDP contexts and bail out */ pool_close_all_pdp(apn->v4.pool); -- cgit v1.2.3