Change in osmo-msc[master]: require 'ipa-name' option to be set via config file

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 Dec 13 13:51:31 UTC 2018


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

Change subject: require 'ipa-name' option to be set via config file
......................................................................

require 'ipa-name' option to be set via config file

The 'ipa-name' option can now only be set via the configuration file
because changing the IPA name at run-time conflicts with active
GSUP connections and routes configured in the HLR. The osmo-msc
program must be restarted if its IPA name needs to change.

Change-Id: I6cff91793e646e0396e8f1bc87d0f52709e5f12a
Related: OS#3355
---
M include/osmocom/msc/vty.h
M src/libmsc/msc_vty.c
M src/osmo-msc/msc_main.c
3 files changed, 13 insertions(+), 0 deletions(-)

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



diff --git a/include/osmocom/msc/vty.h b/include/osmocom/msc/vty.h
index 6a55df7..60a36d7 100644
--- a/include/osmocom/msc/vty.h
+++ b/include/osmocom/msc/vty.h
@@ -31,4 +31,6 @@
 
 struct gsm_network *gsmnet_from_vty(struct vty *vty);
 
+extern bool msc_parsing_config_file;
+
 #endif
diff --git a/src/libmsc/msc_vty.c b/src/libmsc/msc_vty.c
index 06e1139..87adc82 100644
--- a/src/libmsc/msc_vty.c
+++ b/src/libmsc/msc_vty.c
@@ -466,6 +466,12 @@
       "This name is used for GSUP routing and must be set if more than one MSC is connected to the HLR. "
       "The default is 'MSC-00-00-00-00-00-00'.\n")
 {
+	if (!msc_parsing_config_file) {
+		vty_out(vty, "The IPA name cannot be changed at run-time; "
+			"It can only be set in the configuraton file.%s", VTY_NEWLINE);
+		return CMD_WARNING;
+	}
+
 	gsmnet->msc_ipa_name = talloc_strdup(gsmnet, argv[0]);
 	return CMD_SUCCESS;
 }
diff --git a/src/osmo-msc/msc_main.c b/src/osmo-msc/msc_main.c
index 8500b97..ce6ae38 100644
--- a/src/osmo-msc/msc_main.c
+++ b/src/osmo-msc/msc_main.c
@@ -24,6 +24,7 @@
  *
  */
 
+#include <stdbool.h>
 #include <unistd.h>
 #include <time.h>
 #include <errno.h>
@@ -514,6 +515,8 @@
 extern void *tall_call_ctx;
 extern void *tall_trans_ctx;
 
+bool msc_parsing_config_file = false;
+
 int main(int argc, char **argv)
 {
 	int rc;
@@ -566,7 +569,9 @@
 		return -1;
 #endif
 
+	msc_parsing_config_file = true;
 	rc = vty_read_config_file(msc_cmdline_config.config_file, NULL);
+	msc_parsing_config_file = false;
 	if (rc < 0) {
 		LOGP(DMSC, LOGL_FATAL, "Failed to parse the config file: '%s'\n",
 		     msc_cmdline_config.config_file);

-- 
To view, visit https://gerrit.osmocom.org/12293
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: I6cff91793e646e0396e8f1bc87d0f52709e5f12a
Gerrit-Change-Number: 12293
Gerrit-PatchSet: 1
Gerrit-Owner: Stefan Sperling <stsp at stsp.name>
Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Jenkins Builder (1000002)
Gerrit-CC: Max <msuraev at sysmocom.de>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20181213/6160c33f/attachment.htm>


More information about the gerrit-log mailing list