Change in osmo-bsc[master]: main: exit on mutually exclusive codecs settings

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

osmith gerrit-no-reply at lists.osmocom.org
Tue Mar 17 11:24:39 UTC 2020


osmith has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-bsc/+/17491 )


Change subject: main: exit on mutually exclusive codecs settings
......................................................................

main: exit on mutually exclusive codecs settings

Refuse to start with mutually exclusive codec settings, unless
--allow-unusable-timeslots command-line argument is set. The checks were
already implemented and fill the error log if the config is invalid.

Related: OS#3739
Change-Id: I3ccfc3b0a8641400cb97a23b24d7ed92d2ad25cd
---
M src/osmo-bsc/osmo_bsc_main.c
1 file changed, 11 insertions(+), 2 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/91/17491/1

diff --git a/src/osmo-bsc/osmo_bsc_main.c b/src/osmo-bsc/osmo_bsc_main.c
index 66310b3..6a1d5ec 100644
--- a/src/osmo-bsc/osmo_bsc_main.c
+++ b/src/osmo-bsc/osmo_bsc_main.c
@@ -84,6 +84,7 @@
 static const char *config_file = "osmo-bsc.cfg";
 static const char *rf_ctrl = NULL;
 static int daemonize = 0;
+static int allow_unusable_timeslots = 0;
 static LLIST_HEAD(access_lists);
 
 struct llist_head *bsc_access_lists(void)
@@ -110,6 +111,7 @@
 	printf("  -e --log-level number		Set a global loglevel.\n");
 	printf("  -r --rf-ctl NAME		A unix domain socket to listen for cmds.\n");
 	printf("  -t --testmode			A special mode to provoke failures at the MSC.\n");
+	printf("  -a --allow-unusable-timeslots Don't refuse to start with mutually exclusive codec settings.\n");
 }
 
 static void handle_options(int argc, char **argv)
@@ -128,10 +130,11 @@
 			{"log-level", 1, 0, 'e'},
 			{"rf-ctl", 1, 0, 'r'},
 			{"testmode", 0, 0, 't'},
+			{"allow-unusable-timeslots", 0, 0, 'a'},
 			{0, 0, 0, 0}
 		};
 
-		c = getopt_long(argc, argv, "hd:DsTVc:e:r:t",
+		c = getopt_long(argc, argv, "hd:DsTVc:e:r:ta",
 				long_options, &option_index);
 		if (c == -1)
 			break;
@@ -166,6 +169,9 @@
 		case 'r':
 			rf_ctrl = optarg;
 			break;
+		case 'a':
+			allow_unusable_timeslots = 1;
+			break;
 		default:
 			/* ignore */
 			break;
@@ -902,8 +908,11 @@
 	}
 
 	rc = check_codec_pref(&bsc_gsmnet->bsc_data->mscs);
-	if (rc < 0)
+	if (rc < 0) {
 		LOGP(DMSC, LOGL_ERROR, "Configuration contains mutually exclusive codec settings -- check configuration!\n");
+		if (!allow_unusable_timeslots)
+			exit(1);
+	}
 
 	llist_for_each_entry(msc, &bsc_gsmnet->bsc_data->mscs, entry) {
 		if (osmo_bsc_msc_init(msc) != 0) {

-- 
To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/17491
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: I3ccfc3b0a8641400cb97a23b24d7ed92d2ad25cd
Gerrit-Change-Number: 17491
Gerrit-PatchSet: 1
Gerrit-Owner: osmith <osmith at sysmocom.de>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20200317/3f48701c/attachment.htm>


More information about the gerrit-log mailing list