Change in osmo-bsc[master]: CBC VTY: make CBSP server and client mutually exclusive

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

neels gerrit-no-reply at lists.osmocom.org
Wed Aug 26 15:56:27 UTC 2020


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


Change subject: CBC VTY: make CBSP server and client mutually exclusive
......................................................................

CBC VTY: make CBSP server and client mutually exclusive

Do not allow osmo-bsc to be configured as CBC client *and* CBC server at the
same time.

This patch will break all BSC_Tests_CBSP, until the 'cbc' section in
osmo-bsc.cfg is removed, and until the patch to apply the CBC config via
f_vty_transceive is applied. See I7eea0dd39de50ed80af79e0f10c836b8685d8644 in
osmo-ttcn3-hacks.

Rationale:

cbsp_link.c expects at most one CBSP link to be established, and, upon sending
CBSP messages, probes whether to send the message to a CBSP server or client
link. When both listen-port and remote-ip are configured (regardless of an
actual CBSP connection), osmo-bsc gets confused about where to send CBSP
messages.

One solution would be more accurate probing for an actual established TCP
connection. But the simpler and less confusing solution is to force the user to
configure only server or only client mode, never both.

Related: I7eea0dd39de50ed80af79e0f10c836b8685d8644 (osmo-ttcn3-hacks)
Related: OS#4702
Change-Id: Icf901848e666f079d14450962f0a1d74b0996c56
---
M src/osmo-bsc/cbsp_link.c
1 file changed, 16 insertions(+), 0 deletions(-)



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

diff --git a/src/osmo-bsc/cbsp_link.c b/src/osmo-bsc/cbsp_link.c
index 33f2e11..d6e688e 100644
--- a/src/osmo-bsc/cbsp_link.c
+++ b/src/osmo-bsc/cbsp_link.c
@@ -308,6 +308,14 @@
 	CBSP_REMOTE "IP Address of the Cell Broadcast Centre\n")
 {
 	struct bsc_cbc_link *cbc = vty_cbc_data(vty);
+
+	if (cbc->config.listen_port > 0) {
+		vty_out(vty, "%% Error: CBC server and CBC client cannot be enabled at the same time.%s"
+			"%% To set a 'cbc' / 'remote-ip', first set 'cbc' / 'no listen-port'.%s",
+			VTY_NEWLINE, VTY_NEWLINE);
+		return CMD_WARNING;
+	}
+
 	osmo_talloc_replace_string(cbc, &cbc->config.cbc_hostname, argv[0]);
 	return CMD_SUCCESS;
 }
@@ -339,6 +347,14 @@
 	"Local TCP port at which BSC listens for incoming CBSP connections from CBC\n")
 {
 	struct bsc_cbc_link *cbc = vty_cbc_data(vty);
+
+	if (cbc->config.cbc_hostname) {
+		vty_out(vty, "%% Error: CBC server and CBC client cannot be enabled at the same time.%s"
+			"%% To set a 'cbc' / 'listen-port', first set 'cbc' / 'no remote-ip'.%s",
+			VTY_NEWLINE, VTY_NEWLINE);
+		return CMD_WARNING;
+	}
+
 	cbc->config.listen_port = atoi(argv[0]);
 	return CMD_SUCCESS;
 }

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

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: Icf901848e666f079d14450962f0a1d74b0996c56
Gerrit-Change-Number: 19836
Gerrit-PatchSet: 1
Gerrit-Owner: neels <nhofmeyr at sysmocom.de>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20200826/24e571fc/attachment.htm>


More information about the gerrit-log mailing list