aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Couzens <lynxis@fe80.eu>2021-03-21 16:25:18 +0100
committerlynxis lazus <lynxis@fe80.eu>2021-03-24 15:42:45 +0000
commit3e539ed12707aba23c90626669a3a95fdd64e22a (patch)
treed0a27805d2f0610ca3639cba21b4b874572badde
parent75b6188974728f1f66a65726e1eb481f0d691e7c (diff)
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
-rw-r--r--src/gb/gprs_ns2_vty.c13
1 files 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)