[MERGED] osmo-ggsn[master]: apn_start(): fix clean-up after errors bringing up APN

Harald Welte gerrit-no-reply at lists.osmocom.org
Sun Oct 1 10:23:46 UTC 2017


Harald Welte has submitted this change and it was merged.

Change subject: apn_start(): fix clean-up after errors bringing up APN
......................................................................


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(-)

Approvals:
  Harald Welte: Looks good to me, approved
  Jenkins Builder: Verified



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: merged
Gerrit-Change-Id: I2917a6258cb73cc12fd9d81296ff0eaa616890b9
Gerrit-PatchSet: 1
Gerrit-Project: osmo-ggsn
Gerrit-Branch: master
Gerrit-Owner: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Jenkins Builder


More information about the gerrit-log mailing list