pespin has submitted this change. (
https://gerrit.osmocom.org/c/libosmo-sccp/+/34352?usp=email )
Change subject: asp,xua_srv: Use new osmo_stream API to request sockopt SCTP AUTH/ASCONF
SUPPORTED
......................................................................
asp,xua_srv: Use new osmo_stream API to request sockopt SCTP AUTH/ASCONF SUPPORTED
Support to enable AUTH/ASCONF in the SCTP socket was added recently in
libosmocore and libosmo-netif, in order to support the Peer Primary
Address features used by the libosmo-sccp code.
The code to request the AUTH/ASCONF support through setsockopt() was
internally applied transparently by lisbosmo-netif's osmo_stream. This
is not 100% disarable since other users of the library may not need/want
that behavior.
As a result, libosmo-netif's osmo_stream no longer enables the SCTP
AUTH/ASCONF support by default, but it must be enabled through
the new osmo_stream_{cli,srv_link}_set_param() API.
This change in behavior of the API/implementation can be done because
all these new features are pretty new and no release of
libosmocore/libosmo-netif/libosmo-sccp has been released yet.
Related: SYS#6501
Related: SYS#6558
Depends: libosmo-netif.git Change-Id I2607c1c926a625986cd851adc65dd8b4de83d6ab
Change-Id: I16c97fc148792aa3e39b7414899660990c39dfff
---
M TODO-RELEASE
M src/osmo_ss7_asp.c
M src/osmo_ss7_xua_srv.c
3 files changed, 41 insertions(+), 1 deletion(-)
Approvals:
laforge: Looks good to me, but someone else must approve
fixeria: Looks good to me, approved
pespin: Verified
diff --git a/TODO-RELEASE b/TODO-RELEASE
index 306eed9..172a1f9 100644
--- a/TODO-RELEASE
+++ b/TODO-RELEASE
@@ -11,5 +11,5 @@
libosmo-netif > 1.3.0 uses osmo_stream_*_set_name()
libosmo-sccp add API osmo_ss7_asp_get_name(), osmo_ss7_asp_get_proto()
osmo_sccp_simple_client_on_ss7_id() behavior change: ASPs asp-clnt-* defined through VTY
must explicitly configure "role" and "sctp-role"
-libosmo-netif > 1.3.0 flag OSMO_STREAM_SCTP_MSG_FLAGS_NOTIFICATION set by
osmo_stream_cli_recv()
+libosmo-netif > 1.3.0 osmo_stream_srv_link_set_param(),
osmo_stream_srv_link_set_param()
libosmo-sccp add API osmo_ss7_asp_peer_init(), osmo_ss7_asp_peer_set_hosts2(),
osmo_ss7_asp_peer_add_host2()
diff --git a/src/osmo_ss7_asp.c b/src/osmo_ss7_asp.c
index c282730..ab01abd 100644
--- a/src/osmo_ss7_asp.c
+++ b/src/osmo_ss7_asp.c
@@ -722,6 +722,7 @@
{
int rc;
char bufloc[512], bufrem[512];
+ uint8_t byte;
OSMO_ASSERT(ss7_initialized);
osmo_ss7_asp_peer_snprintf(bufloc, sizeof(bufloc), &asp->cfg.local);
@@ -758,6 +759,10 @@
else
osmo_stream_cli_set_read_cb(asp->client, xua_cli_read_cb);
osmo_stream_cli_set_data(asp->client, asp);
+ byte = 1; /*AUTH is needed by ASCONF. enable, don't abort socket creation if AUTH
can't be enabled */
+ osmo_stream_cli_set_param(asp->client,
OSMO_STREAM_CLI_PAR_SCTP_SOCKOPT_AUTH_SUPPORTED, &byte, sizeof(byte));
+ byte = 1; /* enable, don't abort socket creation if ASCONF can't be enabled */
+ osmo_stream_cli_set_param(asp->client,
OSMO_STREAM_CLI_PAR_SCTP_SOCKOPT_ASCONF_SUPPORTED, &byte, sizeof(byte));
rc = osmo_stream_cli_open(asp->client);
if (rc < 0) {
LOGPASP(asp, DLSS7, LOGL_ERROR, "Unable to open stream"
diff --git a/src/osmo_ss7_xua_srv.c b/src/osmo_ss7_xua_srv.c
index 04ae893..57e909a 100644
--- a/src/osmo_ss7_xua_srv.c
+++ b/src/osmo_ss7_xua_srv.c
@@ -227,6 +227,7 @@
{
char buf[512];
int rc;
+ uint8_t byte;
const char *proto = get_value_string(osmo_ss7_asp_protocol_vals, xs->cfg.proto);
rc = osmo_ss7_asp_peer_snprintf(buf, sizeof(buf), &xs->cfg.local);
@@ -236,6 +237,13 @@
LOGP(DLSS7, LOGL_INFO, "(Re)binding %s Server to %s\n",
proto, buf);
}
+
+ /* Applying xUA Server config which may have changed through VTY on the srv_link before
opening it: */
+ byte = 1; /*AUTH is needed by ASCONF. enable, don't abort socket creation if AUTH
can't be enabled */
+ osmo_stream_srv_link_set_param(xs->server,
OSMO_STREAM_SRV_LINK_PAR_SCTP_SOCKOPT_AUTH_SUPPORTED, &byte, sizeof(byte));
+ byte = 1; /* enable, don't abort socket creation if ASCONF can't be enabled */
+ osmo_stream_srv_link_set_param(xs->server,
OSMO_STREAM_SRV_LINK_PAR_SCTP_SOCKOPT_ASCONF_SUPPORTED, &byte, sizeof(byte));
+
return osmo_stream_srv_link_open(xs->server);
}
--
To view, visit
https://gerrit.osmocom.org/c/libosmo-sccp/+/34352?usp=email
To unsubscribe, or for help writing mail filters, visit
https://gerrit.osmocom.org/settings
Gerrit-Project: libosmo-sccp
Gerrit-Branch: master
Gerrit-Change-Id: I16c97fc148792aa3e39b7414899660990c39dfff
Gerrit-Change-Number: 34352
Gerrit-PatchSet: 2
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: osmith <osmith(a)sysmocom.de>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-MessageType: merged