Change in libosmocore[master]: fixup vty sns

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

lynxis lazus gerrit-no-reply at lists.osmocom.org
Thu Dec 10 14:24:40 UTC 2020


lynxis lazus has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmocore/+/21651 )


Change subject: fixup vty sns
......................................................................

fixup vty sns

Change-Id: Ifc328455129ee3025b174d608e7c238e4252773b
---
M src/gb/gprs_ns2_vty2.c
1 file changed, 11 insertions(+), 11 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/51/21651/1

diff --git a/src/gb/gprs_ns2_vty2.c b/src/gb/gprs_ns2_vty2.c
index 2c7d00d..9f2036e 100644
--- a/src/gb/gprs_ns2_vty2.c
+++ b/src/gb/gprs_ns2_vty2.c
@@ -1080,7 +1080,7 @@
 	struct osmo_sockaddr_str remote_str; /* argv[2] */
 	struct osmo_sockaddr remote;
 	uint16_t port = atoi(argv[3]);
-	int rc;
+	int count;
 
 	if (nse->ll != GPRS_NS2_LL_UDP) {
 		vty_out(vty, "This NSE doesn't support UDP.%s", VTY_NEWLINE);
@@ -1102,20 +1102,20 @@
 		return CMD_WARNING;
 	}
 
-	rc = gprs_ns2_sns_del_endpoint(nse, &remote);
-	if (rc) {
+	if (gprs_ns2_sns_del_endpoint(nse, &remote)) {
 		vty_out(vty, "Can not remove specified SNS endpoint.%s", VTY_NEWLINE);
 		return CMD_WARNING;
 	}
 
-	/* TODO:
-	 * - check if sns has endpoints
-	 * - if !empty -> CMD SUCCESS
-	 * - remove sns fsm
-	 * - set to LL/DIALECT to undef
-	 */
-
-	if (llist_empty(&nse->nsvc)) {
+	count = gprs_ns2_sns_count(nse);
+	if (count > 0) {
+		 /* there are other sns endpoints */
+		return CMD_SUCCESS;
+	} else if (count < 0) {
+		OSMO_ASSERT(0);
+	} else {
+		/* clean up nse to allow other nsvc commands */
+		osmo_fsm_inst_term(nse->bss_sns_fi, OSMO_FSM_TERM_REQUEST, NULL);
 		nse->ll = GPRS_NS2_LL_UNDEF;
 		nse->dialect = NS2_DIALECT_UNDEF;
 	}

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

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: Ifc328455129ee3025b174d608e7c238e4252773b
Gerrit-Change-Number: 21651
Gerrit-PatchSet: 1
Gerrit-Owner: lynxis lazus <lynxis at fe80.eu>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20201210/33ecda51/attachment.htm>


More information about the gerrit-log mailing list