aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKeith <keith@rhizomatica.org>2021-05-20 04:41:01 +0200
committerKeith <keith@rhizomatica.org>2021-05-20 04:41:22 +0200
commitc12c1a6b0c3d72d282b4e90b7d44fb58dfaa1922 (patch)
tree8de3f1c43a1fab715fa9d73fb58d47689947562c /src
parente5c8998f9c76de69f646aab5001a1e9882bc02b6 (diff)
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
Diffstat (limited to 'src')
-rw-r--r--src/sgsn/sgsn_vty.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/sgsn/sgsn_vty.c b/src/sgsn/sgsn_vty.c
index 76d5202b..3b2a04a8 100644
--- a/src/sgsn/sgsn_vty.c
+++ b/src/sgsn/sgsn_vty.c
@@ -654,7 +654,7 @@ DEFUN(swow_mmctx_imsi, show_mmctx_imsi_cmd,
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 @@ DEFUN(swow_mmctx_all, show_mmctx_all_cmd,
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;
}