[PATCH] libosmo-sccp[master]: vty: fix (null) string in vty config

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

dexter gerrit-no-reply at lists.osmocom.org
Tue Aug 15 08:48:21 UTC 2017


Review at  https://gerrit.osmocom.org/3525

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
---
M src/osmo_ss7_vty.c
1 file changed, 2 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.osmocom.org:29418/libosmo-sccp refs/changes/25/3525/1

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 @@
 		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);
 }

-- 
To view, visit https://gerrit.osmocom.org/3525
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I18f79cc4d4f1db8f2858e8e95098c5821d50594f
Gerrit-PatchSet: 1
Gerrit-Project: libosmo-sccp
Gerrit-Branch: master
Gerrit-Owner: dexter <pmaier at sysmocom.de>



More information about the gerrit-log mailing list