pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmo-sccp/+/33216 )
Change subject: osmo_sccp_simple_client_on_ss7_id(): Fail to start a client on an ASP explicitly configured as sctp server ......................................................................
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