daniel has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmo-netif/+/33327 )
Change subject: stream: Document osmo_stream_cli_create2()
......................................................................
stream: Document osmo_stream_cli_create2()
Change-Id: I0c2f46e02d94c3459e4043a9db7fccd906521dd2
---
M src/stream.c
1 file changed, 16 insertions(+), 1 deletion(-)
git pull ssh://gerrit.osmocom.org:29418/libosmo-netif refs/changes/27/33327/1
diff --git a/src/stream.c b/src/stream.c
index b6ef92f..d46bc78 100644
--- a/src/stream.c
+++ b/src/stream.c
@@ -616,7 +616,13 @@
.segmentation_cb = NULL,
};
-
+/*! \brief Create an Osmocom stream client
+ * \param[in] ctx talloc context from which to allocate memory
+ * This function allocates a new \ref osmo_stream_cli and initializes
+ * it with default values (5s reconnect timer, TCP protocol)
+ * \param[in] name a description of the stream client. Will be used in logging
+ * \return allocated stream client, or NULL in case of error
+ */
struct osmo_stream_cli *osmo_stream_cli_create2(void *ctx, const char *name)
{
struct osmo_stream_cli *cli;
--
To view, visit https://gerrit.osmocom.org/c/libosmo-netif/+/33327
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: libosmo-netif
Gerrit-Branch: master
Gerrit-Change-Id: I0c2f46e02d94c3459e4043a9db7fccd906521dd2
Gerrit-Change-Number: 33327
Gerrit-PatchSet: 1
Gerrit-Owner: daniel <dwillmann(a)sysmocom.de>
Gerrit-MessageType: newchange
pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmo-sccp/+/33325 )
Change subject: Forbid partial VTY configurations of ASPs with name asp-clnt-*
......................................................................
Forbid partial VTY configurations of ASPs with name asp-clnt-*
A recent commit (83db938859428ce3835239e2692d93c557b750e1) changed the
behavior of default "sctp-role" and "role" values of ASPs named
asp-clnt-* which are used by osmo_sccp_simple_client_on_ss7_id(), in
order to avoid having different default values when than function is
used, which is totally confusing for end users.
As it was already informed when submitting the mentioned commit, it
changes the behavior on that specific case, and that made some users
start having problems without a proper "your config is wrong!" error.
This commit addresses it by basically forbiding that exact use case,
that is, partially defining an asp-clnt-* ASP through VTY without
explicitly configuring a "role" and "sctp-role". With this patch,
function osmo_sccp_simple_client_on_ss7_id() will print a proper error
informing the user and will return NULL, potentially triggering an early
program exit which can then easily be fixed by using proper
configuration.
Related: SYS#6486
Change-Id: I65b5fad2ec06a9d9c521f1e3ce8aab633da95a47
---
M TODO-RELEASE
M include/osmocom/sigtran/osmo_ss7.h
M src/osmo_ss7_vty.c
M src/sccp_user.c
4 files changed, 68 insertions(+), 14 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/libosmo-sccp refs/changes/25/33325/1
diff --git a/TODO-RELEASE b/TODO-RELEASE
index 05e12a6..ede41b5 100644
--- a/TODO-RELEASE
+++ b/TODO-RELEASE
@@ -8,3 +8,4 @@
# If any interfaces have been removed or changed since the last public release: c:r:0.
#library what description / commit summary line
libosmocore >1.8.0 uses new osmo_prim_operation_name()
+osmo_sccp_simple_client_on_ss7_id() behavior change: ASPs asp-clnt-* defined through VTY must explicitly configure "role" and "sctp-role"
\ No newline at end of file
diff --git a/include/osmocom/sigtran/osmo_ss7.h b/include/osmocom/sigtran/osmo_ss7.h
index eff16b9..f413983 100644
--- a/include/osmocom/sigtran/osmo_ss7.h
+++ b/include/osmocom/sigtran/osmo_ss7.h
@@ -430,6 +430,8 @@
enum osmo_ss7_asp_admin_state adm_state;
bool is_server;
enum osmo_ss7_asp_role role;
+ bool role_set_by_vty;
+ bool sctp_role_set_by_vty;
struct osmo_ss7_asp_peer local;
struct osmo_ss7_asp_peer remote;
diff --git a/src/osmo_ss7_vty.c b/src/osmo_ss7_vty.c
index 09e5f0a..ebec5f6 100644
--- a/src/osmo_ss7_vty.c
+++ b/src/osmo_ss7_vty.c
@@ -715,6 +715,8 @@
return CMD_WARNING;
} else
OSMO_ASSERT(0);
+
+ asp->cfg.role_set_by_vty = true;
return CMD_SUCCESS;
}
@@ -733,6 +735,8 @@
asp->cfg.is_server = true;
else
OSMO_ASSERT(0);
+
+ asp->cfg.sctp_role_set_by_vty = true;
return CMD_SUCCESS;
}
diff --git a/src/sccp_user.c b/src/sccp_user.c
index aac6ee0..1b0758e 100644
--- a/src/sccp_user.c
+++ b/src/sccp_user.c
@@ -646,24 +646,43 @@
osmo_ss7_as_add_asp(as, asp->cfg.name);
}
- /* If ASP was configured through VTY it may be explicitly configured as
- * SCTP server. It may be a bit confusing since this function is to create
- * a "SCCP simple client", but this allows users of this API such as
- * osmo-hnbgw to support SCTP-role server if properly configured through VTY.
- */
- if (asp->cfg.is_server) {
- struct osmo_xua_server *xs;
- LOGP(DLSCCP, LOGL_NOTICE,
- "%s: Requesting an SCCP simple client on ASP %s configured with 'sctp-role server'\n",
- name, asp->cfg.name);
- xs = osmo_ss7_xua_server_find(ss7, prot, asp->cfg.local.port);
- if (!xs) {
+ /* Extra sanity checks if the ASP asp-clnt-* was pre-configured over VTY: */
+ if (!asp->simple_client_allocated) {
+ /* Forbid ASPs defined through VTY that are not entirely
+ * configured. "role" and "sctp-role" must be explicitly provided:
+ */
+ if (!asp->cfg.role_set_by_vty) {
LOGP(DLSCCP, LOGL_ERROR,
- "%s: Requesting an SCCP simple client on ASP %s configured with 'sctp-role server' "
- "but no matching xUA server was configured!\n",
+ "%s: ASP %s defined in VTY but 'role' was not set there, please set it.\n",
name, asp->cfg.name);
goto out_asp;
}
+ if (!asp->cfg.sctp_role_set_by_vty) {
+ LOGP(DLSCCP, LOGL_ERROR,
+ "%s: ASP %s defined in VTY but 'sctp-role' was not set there, please set it.\n",
+ name, asp->cfg.name);
+ goto out_asp;
+ }
+
+ /* If ASP was configured through VTY it may be explicitly configured as
+ * SCTP server. It may be a bit confusing since this function is to create
+ * a "SCCP simple client", but this allows users of this API such as
+ * osmo-hnbgw to support SCTP-role server if properly configured through VTY.
+ */
+ if (asp->cfg.is_server) {
+ struct osmo_xua_server *xs;
+ LOGP(DLSCCP, LOGL_NOTICE,
+ "%s: Requesting an SCCP simple client on ASP %s configured with 'sctp-role server'\n",
+ name, asp->cfg.name);
+ xs = osmo_ss7_xua_server_find(ss7, prot, asp->cfg.local.port);
+ if (!xs) {
+ LOGP(DLSCCP, LOGL_ERROR,
+ "%s: Requesting an SCCP simple client on ASP %s configured with 'sctp-role server' "
+ "but no matching xUA server was configured!\n",
+ name, asp->cfg.name);
+ goto out_asp;
+ }
+ }
}
/* Restart ASP */
--
To view, visit https://gerrit.osmocom.org/c/libosmo-sccp/+/33325
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: libosmo-sccp
Gerrit-Branch: master
Gerrit-Change-Id: I65b5fad2ec06a9d9c521f1e3ce8aab633da95a47
Gerrit-Change-Number: 33325
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-MessageType: newchange
Attention is currently required from: daniel.
pespin has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-bsc/+/33324 )
Change subject: cosmetic: Fix type in VTY description
......................................................................
Patch Set 1: Code-Review+2
--
To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/33324
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: I3301d1c84b3386e0a4e9c3f18f89aee62e9097d5
Gerrit-Change-Number: 33324
Gerrit-PatchSet: 1
Gerrit-Owner: daniel <dwillmann(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: daniel <dwillmann(a)sysmocom.de>
Gerrit-Comment-Date: Thu, 15 Jun 2023 16:52:05 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment
pespin has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/33323 )
Change subject: bsc: Introduce test TC_mgwpool_keepalive
......................................................................
Patch Set 2:
This change is ready for review.
--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/33323
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: Ib3cd00dafee87258ac229df78217326a6182f028
Gerrit-Change-Number: 33323
Gerrit-PatchSet: 2
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Comment-Date: Thu, 15 Jun 2023 16:47:50 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: No
Gerrit-MessageType: comment
Attention is currently required from: laforge, dexter.
pespin has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-mgw/+/33312 )
Change subject: mgw: Allow auditing speciall 'null' endpoint
......................................................................
Patch Set 3:
(1 comment)
File src/libosmo-mgcp/mgcp_protocol.c:
https://gerrit.osmocom.org/c/osmo-mgw/+/33312/comment/61ed9bf5_afa826c4
PS2, Line 473:
> one option might be to turn the null endpoint into a real endpoint, one that just drops all data it […]
The main discussion to start with would be: Do we still want the null endpoint to be per-trunk? That would mean it ends up like "rtpbridge/null@mgw", instead of "null@mgw" we have now.
This means we would have a trunk pointer available in the handlers, which may be handy and maybe allow having less specific code paths.
On the other hand, that means the user has to figure out which trunk to use.
Regarding acceptance of any data: That would mean we need to still create a separate endpoint object internally in osmo-mgw. Since we don't really need that right now, I really preferred skipping it since it may take some effort, since special cases may need to be checked all along where "endp" objects are being used.
--
To view, visit https://gerrit.osmocom.org/c/osmo-mgw/+/33312
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-mgw
Gerrit-Branch: master
Gerrit-Change-Id: Ia409b16e9211e6261e2e0f21288544289d6f3733
Gerrit-Change-Number: 33312
Gerrit-PatchSet: 3
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: dexter <pmaier(a)sysmocom.de>
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: osmith <osmith(a)sysmocom.de>
Gerrit-Attention: laforge <laforge(a)osmocom.org>
Gerrit-Attention: dexter <pmaier(a)sysmocom.de>
Gerrit-Comment-Date: Thu, 15 Jun 2023 15:25:52 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: laforge <laforge(a)osmocom.org>
Comment-In-Reply-To: pespin <pespin(a)sysmocom.de>
Comment-In-Reply-To: dexter <pmaier(a)sysmocom.de>
Gerrit-MessageType: comment