Change in libosmocore[master]: gprs_ns2: add gprs_ns2_free_binds() to free all binds

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

laforge gerrit-no-reply at lists.osmocom.org
Mon Oct 12 13:08:44 UTC 2020


laforge has submitted this change. ( https://gerrit.osmocom.org/c/libosmocore/+/20555 )

Change subject: gprs_ns2: add gprs_ns2_free_binds() to free all binds
......................................................................

gprs_ns2: add gprs_ns2_free_binds() to free all binds

Allow users to clean up all binds (e.g. the PCU).

Change-Id: Ic8f6f8aca10da23a18fab8870be7806065a34b47
---
M include/osmocom/gprs/gprs_ns2.h
M src/gb/gprs_ns2.c
M src/gb/libosmogb.map
3 files changed, 12 insertions(+), 4 deletions(-)

Approvals:
  laforge: Looks good to me, but someone else must approve
  daniel: Looks good to me, approved
  pespin: Looks good to me, but someone else must approve
  Jenkins Builder: Verified



diff --git a/include/osmocom/gprs/gprs_ns2.h b/include/osmocom/gprs/gprs_ns2.h
index d798ac4..2c58723 100644
--- a/include/osmocom/gprs/gprs_ns2.h
+++ b/include/osmocom/gprs/gprs_ns2.h
@@ -131,6 +131,7 @@
 					uint16_t nsvci);
 
 void gprs_ns2_free_bind(struct gprs_ns2_vc_bind *bind);
+void gprs_ns2_free_binds(struct gprs_ns2_inst *nsi);
 
 /* create a VC SNS connection */
 int gprs_ns2_ip_connect_sns(struct gprs_ns2_vc_bind *bind,
diff --git a/src/gb/gprs_ns2.c b/src/gb/gprs_ns2.c
index 58304cd..e3fc078 100644
--- a/src/gb/gprs_ns2.c
+++ b/src/gb/gprs_ns2.c
@@ -997,7 +997,6 @@
  *  \param[in] nsi NS instance to destroy */
 void gprs_ns2_free(struct gprs_ns2_inst *nsi)
 {
-	struct gprs_ns2_vc_bind *bind, *tbind;
 	struct gprs_ns2_nse *nse, *ntmp;
 
 	if (!nsi)
@@ -1007,9 +1006,7 @@
 		gprs_ns2_free_nse(nse);
 	}
 
-	llist_for_each_entry_safe(bind, tbind, &nsi->binding, list) {
-		gprs_ns2_free_bind(bind);
-	}
+	gprs_ns2_free_binds(nsi);
 
 	talloc_free(nsi);
 }
@@ -1067,4 +1064,13 @@
 	llist_del(&bind->list);
 	talloc_free(bind);
 }
+
+void gprs_ns2_free_binds(struct gprs_ns2_inst *nsi)
+{
+	struct gprs_ns2_vc_bind *bind, *tbind;
+
+	llist_for_each_entry_safe(bind, tbind, &nsi->binding, list) {
+		gprs_ns2_free_bind(bind);
+	}
+}
 /*! @} */
diff --git a/src/gb/libosmogb.map b/src/gb/libosmogb.map
index 3d1d5d6..d23d263 100644
--- a/src/gb/libosmogb.map
+++ b/src/gb/libosmogb.map
@@ -79,6 +79,7 @@
 gprs_ns2_find_vc_by_sockaddr;
 gprs_ns2_free;
 gprs_ns2_free_bind;
+gprs_ns2_free_binds;
 gprs_ns2_free_nse;
 gprs_ns2_free_nsvc;
 gprs_ns2_frgre_bind;

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

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: Ic8f6f8aca10da23a18fab8870be7806065a34b47
Gerrit-Change-Number: 20555
Gerrit-PatchSet: 2
Gerrit-Owner: lynxis lazus <lynxis at fe80.eu>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: daniel <dwillmann at sysmocom.de>
Gerrit-Reviewer: laforge <laforge at osmocom.org>
Gerrit-Reviewer: pespin <pespin at sysmocom.de>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20201012/6e5dca04/attachment.htm>


More information about the gerrit-log mailing list