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

laforge gerrit-no-reply at lists.osmocom.org
Sun May 23 10:31:40 UTC 2021


laforge has submitted this change. ( 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(-)

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



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-Reviewer: Jenkins Builder
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/20210523/5b48ddb5/attachment.htm>


More information about the gerrit-log mailing list