Change in osmo-sgsn[master]: vty: Fix optional display of pdp with mm-context

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

keith gerrit-no-reply at lists.osmocom.org
Thu May 20 02:44:00 UTC 2021


keith has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-sgsn/+/24309 )


Change subject: vty: Fix optional display of pdp with mm-context
......................................................................

vty: Fix optional display of pdp with mm-context

The vty is randomly including the pdp context when the vty
command 'show mm-context all' is issued without the pdp
parameter.
I do not know why, but I assume that relying on a true/false
test of argv[0] has unpredictable results.

Change-Id: Idcde4dd30a39625b24a1c3a38901349875e0949a
---
M src/sgsn/sgsn_vty.c
1 file changed, 2 insertions(+), 3 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-sgsn refs/changes/09/24309/1

diff --git a/src/sgsn/sgsn_vty.c b/src/sgsn/sgsn_vty.c
index 76d5202..3b2a04a 100644
--- a/src/sgsn/sgsn_vty.c
+++ b/src/sgsn/sgsn_vty.c
@@ -654,7 +654,7 @@
 			argv[0], VTY_NEWLINE);
 		return CMD_WARNING;
 	}
-	vty_dump_mmctx(vty, "", mm, argv[1] ? 1 : 0);
+	vty_dump_mmctx(vty, "", mm, (argc > 1) ? 1 : 0);
 	return CMD_SUCCESS;
 }
 
@@ -663,9 +663,8 @@
 	SHOW_STR MMCTX_STR "All MM Contexts\n" INCLUDE_PDP_STR)
 {
 	struct sgsn_mm_ctx *mm;
-
 	llist_for_each_entry(mm, &sgsn_mm_ctxts, list)
-		vty_dump_mmctx(vty, "", mm, argv[0] ? 1 : 0);
+		vty_dump_mmctx(vty, "", mm, (argc > 0) ? 1 : 0);
 
 	return CMD_SUCCESS;
 }

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

Gerrit-Project: osmo-sgsn
Gerrit-Branch: master
Gerrit-Change-Id: Idcde4dd30a39625b24a1c3a38901349875e0949a
Gerrit-Change-Number: 24309
Gerrit-PatchSet: 1
Gerrit-Owner: keith <keith at rhizomatica.org>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20210520/dc1f131d/attachment.htm>


More information about the gerrit-log mailing list