From 52d1ee96173bf8a48622f68c704ae957d3a69c55 Mon Sep 17 00:00:00 2001 From: Philipp Maier Date: Tue, 15 Aug 2017 10:45:34 +0200 Subject: vty: fix (null) string in vty config The asp->cfg.remote.host is allowed to be NULL in cases where the localhost is used. Check if asp->cfg.remote.host is NULL when writing the config file and omit it when it is set to NULL. Change-Id: I18f79cc4d4f1db8f2858e8e95098c5821d50594f --- 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 9343edd..b58c3cb 100644 --- a/src/osmo_ss7_vty.c +++ b/src/osmo_ss7_vty.c @@ -632,7 +632,8 @@ static void write_one_asp(struct vty *vty, struct osmo_ss7_asp *asp) osmo_ss7_asp_protocol_name(asp->cfg.proto), VTY_NEWLINE); if (asp->cfg.description) vty_out(vty, " description %s%s", asp->cfg.description, VTY_NEWLINE); - vty_out(vty, " remote-ip %s%s", asp->cfg.remote.host, VTY_NEWLINE); + if (asp->cfg.remote.host) + vty_out(vty, " remote-ip %s%s", asp->cfg.remote.host, VTY_NEWLINE); if (asp->cfg.qos_class) vty_out(vty, " qos-class %u%s", asp->cfg.qos_class, VTY_NEWLINE); } -- cgit v1.2.3