From 3e539ed12707aba23c90626669a3a95fdd64e22a Mon Sep 17 00:00:00 2001 From: Alexander Couzens Date: Sun, 21 Mar 2021 16:25:18 +0100 Subject: gprs_ns2_vty: hide dynamic NSE information when ask for persistant only dump_nse() should only print persistant NSE when persistant_only argument is set. A NSE can be persistant or dynamic configured. Depending on the NSE all NS-VC must be the same as the NSE. Change-Id: Ibd2c6962eda39a850ab61cf347063934378d2fdc --- src/gb/gprs_ns2_vty.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/src/gb/gprs_ns2_vty.c b/src/gb/gprs_ns2_vty.c index 7cb9ed94..6d34e5ab 100644 --- a/src/gb/gprs_ns2_vty.c +++ b/src/gb/gprs_ns2_vty.c @@ -1870,18 +1870,15 @@ static void dump_nse(struct vty *vty, const struct gprs_ns2_nse *nse, bool stats { struct gprs_ns2_vc *nsvc; + if (persistent_only && !nse->persistent) + return; + vty_out(vty, "NSEI %05u: %s, %s%s", nse->nsei, gprs_ns2_lltype_str(nse->ll), nse->alive ? "ALIVE" : "DEAD", VTY_NEWLINE); ns2_sns_dump_vty(vty, " ", nse, stats); - llist_for_each_entry(nsvc, &nse->nsvc, list) { - if (persistent_only) { - if (nsvc->persistent) - ns2_vty_dump_nsvc(vty, nsvc, stats); - } else { - ns2_vty_dump_nsvc(vty, nsvc, stats); - } - } + llist_for_each_entry(nsvc, &nse->nsvc, list) + ns2_vty_dump_nsvc(vty, nsvc, stats); } static void dump_bind(struct vty *vty, const struct gprs_ns2_vc_bind *bind, bool stats) -- cgit v1.2.3