Change in ...osmo-ggsn[master]: gtp: Re-arrange free pdp ctx code in non-teardown scenario

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

Harald Welte gerrit-no-reply at lists.osmocom.org
Mon Jun 3 11:18:16 UTC 2019


Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/c/osmo-ggsn/+/14293 )

Change subject: gtp: Re-arrange free pdp ctx code in non-teardown scenario
......................................................................

gtp: Re-arrange free pdp ctx code in non-teardown scenario

Code modified actually behaves the same, since gtp_freepdp() also calls
delete cb, and this way it's more consistent with rest of the code base.

Change-Id: I299765816e9d885497110d2e834f7ccdc943052c
---
M gtp/gtp.c
1 file changed, 14 insertions(+), 13 deletions(-)

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



diff --git a/gtp/gtp.c b/gtp/gtp.c
index 5dde6b5..9ae208a 100644
--- a/gtp/gtp.c
+++ b/gtp/gtp.c
@@ -2421,13 +2421,14 @@
 		   because we don't want user to release its related
 		   data and not use it anymore.
 		 */
-		if (gsn->cb_delete_context)
-			gsn->cb_delete_context(pdp);
 		if (pdp == linked_pdp) {
-			linked_pdp->secondary_tei[pdp->nsapi & 0xf0] = 0;
-			linked_pdp->nodata = 1;
-		} else
-			pdp_freepdp(pdp);
+			if (gsn->cb_delete_context)
+				gsn->cb_delete_context(pdp);
+			pdp->secondary_tei[pdp->nsapi & 0xf0] = 0;
+			pdp->nodata = 1;
+		} else {
+			gtp_freepdp(gsn, pdp);
+		}
 	}
 
 	return 0;
@@ -2510,14 +2511,14 @@
 			   because we don't want user to release its related
 			   data and not use it anymore.
 			 */
-			if (gsn->cb_delete_context)
-				gsn->cb_delete_context(pdp);
 			if (pdp == linked_pdp) {
-				linked_pdp->secondary_tei[pdp->nsapi & 0xf0] =
-				    0;
-				linked_pdp->nodata = 1;
-			} else
-				pdp_freepdp(pdp);
+				if (gsn->cb_delete_context)
+					gsn->cb_delete_context(pdp);
+				pdp->secondary_tei[pdp->nsapi & 0xf0] = 0;
+				pdp->nodata = 1;
+			} else {
+				gtp_freepdp(gsn, pdp);
+			}
 		}
 	}
 	/* if (cause == GTPCAUSE_ACC_REQ) */

-- 
To view, visit https://gerrit.osmocom.org/c/osmo-ggsn/+/14293
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ggsn
Gerrit-Branch: master
Gerrit-Change-Id: I299765816e9d885497110d2e834f7ccdc943052c
Gerrit-Change-Number: 14293
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin at sysmocom.de>
Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20190603/00ec986a/attachment.htm>


More information about the gerrit-log mailing list