Change in osmo-msc[master]: libmsc/sgs_vty.c: always write server address and VLR name

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/.

Harald Welte gerrit-no-reply at lists.osmocom.org
Thu Feb 28 10:31:22 UTC 2019


Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/13017 )

Change subject: libmsc/sgs_vty.c: always write server address and VLR name
......................................................................

libmsc/sgs_vty.c: always write server address and VLR name

Comparing an array to null is not useful, because the expression
will always evaluate as true. Let's just always write SGs server
address and VLR name, no mater whether default values are used
or not, same as we do for the HLR address and port.

Change-Id: If045e42fca0315b0777eb86c44bf934ce58b340b
Fixes: CID#190871 Array compared against 0 (NO_EFFECT)
---
M src/libmsc/sgs_vty.c
M tests/test_nodes.vty
2 files changed, 4 insertions(+), 6 deletions(-)

Approvals:
  Jenkins Builder: Verified
  Harald Welte: Looks good to me, approved



diff --git a/src/libmsc/sgs_vty.c b/src/libmsc/sgs_vty.c
index 5b26178..8c94301 100644
--- a/src/libmsc/sgs_vty.c
+++ b/src/libmsc/sgs_vty.c
@@ -158,12 +158,9 @@
 	char str_buf[256];
 
 	vty_out(vty, "sgs%s", VTY_NEWLINE);
-	if (sgs->cfg.local_port != SGS_PORT_DEFAULT)
-		vty_out(vty, " local-port %u%s", sgs->cfg.local_port, VTY_NEWLINE);
-	if (sgs->cfg.local_addr)
-		vty_out(vty, " local-ip %s%s", sgs->cfg.local_addr, VTY_NEWLINE);
-	if (sgs->cfg.vlr_name)
-		vty_out(vty, " vlr-name %s%s", sgs->cfg.vlr_name, VTY_NEWLINE);
+	vty_out(vty, " local-port %u%s", sgs->cfg.local_port, VTY_NEWLINE);
+	vty_out(vty, " local-ip %s%s", sgs->cfg.local_addr, VTY_NEWLINE);
+	vty_out(vty, " vlr-name %s%s", sgs->cfg.vlr_name, VTY_NEWLINE);
 
 	for (i = 0; i < ARRAY_SIZE(sgs->cfg.timer); i++) {
 		if (sgs->cfg.timer[i] == sgs_state_timer_defaults[i])
diff --git a/tests/test_nodes.vty b/tests/test_nodes.vty
index fb9e5f0..8aceb86 100644
--- a/tests/test_nodes.vty
+++ b/tests/test_nodes.vty
@@ -147,6 +147,7 @@
  remote-ip 127.0.0.1
  remote-port 4222
 sgs
+ local-port 29118
  local-ip 0.0.0.0
  vlr-name vlr.example.net
 end

-- 
To view, visit https://gerrit.osmocom.org/13017
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-msc
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: If045e42fca0315b0777eb86c44bf934ce58b340b
Gerrit-Change-Number: 13017
Gerrit-PatchSet: 4
Gerrit-Owner: Vadim Yanitskiy <axilirator at gmail.com>
Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Jenkins Builder (1000002)
Gerrit-Reviewer: Vadim Yanitskiy <axilirator at gmail.com>
Gerrit-CC: Neels Hofmeyr <nhofmeyr at sysmocom.de>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20190228/1f005125/attachment.htm>


More information about the gerrit-log mailing list