aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNeels Hofmeyr <neels@hofmeyr.de>2018-09-27 00:17:20 +0200
committerNeels Hofmeyr <nhofmeyr@sysmocom.de>2018-09-27 12:39:59 +0000
commitb8cd891148bc7cfd4bf33d48b36ef9b630f5e732 (patch)
tree80d1f77c22c5c2242567613be6187439d2acd2d6
parentee5f37e89fca1ec4da294bd024192b85cb9a7c42 (diff)
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
-rw-r--r--src/osmo_ss7_vty.c3
1 files changed, 2 insertions, 1 deletions
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);
}