xua: Write 'local-ip' only if non-NULL

Avoid writing 'local-ip (null)' to the config file

Change-Id: Ie49f21afd6b29b8e4a3b16f3f18764fea856d196
This commit is contained in:
Harald Welte 2017-11-09 16:05:19 +09:00
parent 67ca594140
commit b7552385b7
1 changed files with 2 additions and 1 deletions

View File

@ -489,7 +489,8 @@ static void write_one_xua(struct vty *vty, struct osmo_xua_server *xs)
vty_out(vty, " listen %s %u%s",
get_value_string(osmo_ss7_asp_protocol_vals, xs->cfg.proto),
xs->cfg.local.port, VTY_NEWLINE);
vty_out(vty, " local-ip %s%s", xs->cfg.local.host, VTY_NEWLINE);
if (xs->cfg.local.host)
vty_out(vty, " local-ip %s%s", xs->cfg.local.host, VTY_NEWLINE);
if (xs->cfg.accept_dyn_reg)
vty_out(vty, " accept-asp-connections dynamic-permitted%s", VTY_NEWLINE);
}