tnt has uploaded this change for review.

View 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(-)

git pull ssh://gerrit.osmocom.org:29418/osmo-e1d refs/changes/26/29726/1
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.

Gerrit-Project: osmo-e1d
Gerrit-Branch: master
Gerrit-Change-Id: I594463591f2945a04ccd708f16788034cc1dfc57
Gerrit-Change-Number: 29726
Gerrit-PatchSet: 1
Gerrit-Owner: tnt <tnt@246tNt.com>
Gerrit-MessageType: newchange