From b8cd891148bc7cfd4bf33d48b36ef9b630f5e732 Mon Sep 17 00:00:00 2001 From: Neels Hofmeyr Date: Thu, 27 Sep 2018 00:17:20 +0200 Subject: vty: fix 'show asp' from within 'asp' node When entering an 'cs7' / 'asp' node, and invoking 'do show cs7 i 0 asp', the ASP's FSM instance is not yet allocated. Hence attempting to print its status will result in a segfault. Spotted this while writing VTY tests that will follow shortly in another patch (I6a28684fa24d6e7de568623444297028eba2ab8c). Change-Id: I3ebf498492c6ba69a5dd1c9f36acdabfd6fbdfe1 --- src/osmo_ss7_vty.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/osmo_ss7_vty.c b/src/osmo_ss7_vty.c index 2f70bb6..d109a0c 100644 --- a/src/osmo_ss7_vty.c +++ b/src/osmo_ss7_vty.c @@ -666,7 +666,8 @@ DEFUN(show_cs7_asp, show_cs7_asp_cmd, llist_for_each_entry(asp, &inst->asp_list, list) { vty_out(vty, "%-12s %-12s %-13s %-4s %-8u %-15s %-10s%s", - asp->cfg.name, "?", osmo_fsm_inst_state_name(asp->fi), + asp->cfg.name, "?", + asp->fi? osmo_fsm_inst_state_name(asp->fi) : "uninitialized", get_value_string(osmo_ss7_asp_protocol_vals, asp->cfg.proto), asp->cfg.remote.port, asp->cfg.remote.host, "", VTY_NEWLINE); } -- cgit v1.2.3