pespin has uploaded this change for review.

View Change

osmo_sccp_simple_client_on_ss7_id(): Fail to start a client on an ASP explicitly configured as sctp server

Right now, if a user configures an cs7 instance, as and asp (with
sctp-role server) in the VTY, then the function
osmo_sccp_simple_client_on_ss7_id() (used by osmo-bsc, osmo-msc,
osmo-hnbgw, etc.) will silently change the config to be SCTP client.
This is really confusing, since the user configured explicitly the ASP
as server but ends up running as client.
Instead, if the user explicitly configured the ASP as SCTP server,
return an error asking the user to apply changes to its config file.

Change-Id: I20de33edb8751a515d6719c49efadfc387dd85f8
---
M src/sccp_user.c
1 file changed, 24 insertions(+), 0 deletions(-)

git pull ssh://gerrit.osmocom.org:29418/libosmo-sccp refs/changes/16/33216/1
diff --git a/src/sccp_user.c b/src/sccp_user.c
index a04a1c3..1de919b 100644
--- a/src/sccp_user.c
+++ b/src/sccp_user.c
@@ -643,6 +643,12 @@
}

/* Ensure that the ASP we use is set to client mode. */
+ if (!asp_created) {
+ LOGP(DLSCCP, LOGL_ERROR,
+ "%s: Requesting an SCCP simple client on ASP %s previously configured with 'sctp-role server'!\n",
+ name, asp->cfg.name);
+ goto out_asp;
+ }
asp->cfg.is_server = false;

/* Make sure that the role of this ASP is set to ASP unless the user

To view, visit change 33216. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: libosmo-sccp
Gerrit-Branch: master
Gerrit-Change-Id: I20de33edb8751a515d6719c49efadfc387dd85f8
Gerrit-Change-Number: 33216
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin@sysmocom.de>
Gerrit-MessageType: newchange