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/.

Pau Espin Pedrol gerrit-no-reply at lists.osmocom.org
Fri May 31 15:03:31 UTC 2019


Pau Espin Pedrol has uploaded this change for review. ( https://gerrit.osmocom.org/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(-)



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

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/14293
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ggsn
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I299765816e9d885497110d2e834f7ccdc943052c
Gerrit-Change-Number: 14293
Gerrit-PatchSet: 1
Gerrit-Owner: Pau Espin Pedrol <pespin at sysmocom.de>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20190531/903b3b0c/attachment.htm>


More information about the gerrit-log mailing list