aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPhilipp Maier <pmaier@sysmocom.de>2017-08-15 10:45:34 +0200
committerPhilipp Maier <pmaier@sysmocom.de>2017-08-15 10:45:34 +0200
commit52d1ee96173bf8a48622f68c704ae957d3a69c55 (patch)
treeed258d0d84924972a30ec2fc8dd31c0fc0e6ea59 /src
parent3219e52dcf6e771bd03ad4abc3823422edb6e5fe (diff)
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
Diffstat (limited to 'src')
-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 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);
}