diff options
author | Keith <keith@rhizomatica.org> | 2021-05-20 04:41:01 +0200 |
---|---|---|
committer | Keith <keith@rhizomatica.org> | 2021-05-20 04:41:22 +0200 |
commit | c12c1a6b0c3d72d282b4e90b7d44fb58dfaa1922 (patch) | |
tree | 8de3f1c43a1fab715fa9d73fb58d47689947562c /src | |
parent | e5c8998f9c76de69f646aab5001a1e9882bc02b6 (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.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/sgsn/sgsn_vty.c b/src/sgsn/sgsn_vty.c index 76d5202bf..3b2a04a85 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; } |