laforge submitted this change.
octoi: Prevent segfault on 'show octoi-clients if a client has no line
This can happen if the specified device in the config isn't plugged
in for instance, no line is created ...
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
Change-Id: I594463591f2945a04ccd708f16788034cc1dfc57
---
M src/octoi/octoi_fsm.c
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/src/octoi/octoi_fsm.c b/src/octoi/octoi_fsm.c
index 39790fa..06d2105 100644
--- a/src/octoi/octoi_fsm.c
+++ b/src/octoi/octoi_fsm.c
@@ -240,7 +240,9 @@
vty_out(vty, " Peer '%s', Remote "OSMO_SOCKADDR_STR_FMT", State %s%s",
peer->name, OSMO_SOCKADDR_STR_FMT_ARGS(&peer->cfg.remote),
osmo_fsm_inst_state_name(peer->priv), VTY_NEWLINE);
- vty_out_rate_ctr_group(vty, " ", peer->iline->ctrs);
- vty_out_stat_item_group(vty, " ", peer->iline->stats);
+ if (peer->iline) {
+ vty_out_rate_ctr_group(vty, " ", peer->iline->ctrs);
+ vty_out_stat_item_group(vty, " ", peer->iline->stats);
+ }
}
}
To view, visit change 29726. To unsubscribe, or for help writing mail filters, visit settings.