Review at  https://gerrit.osmocom.org/4117

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
---
M ggsn/ggsn.c
1 file changed, 0 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-ggsn refs/changes/17/4117/1

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 @@
 
 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);

-- 
To view, visit https://gerrit.osmocom.org/4117
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I2917a6258cb73cc12fd9d81296ff0eaa616890b9
Gerrit-PatchSet: 1
Gerrit-Project: osmo-ggsn
Gerrit-Branch: master
Gerrit-Owner: Harald Welte <[email protected]>

Reply via email to