pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-bsc/+/40706?usp=email )
Change subject: sccp: Handle N-NOTICE.ind (Routing Failure of SCCP CL messages)
......................................................................
sccp: Handle N-NOTICE.ind (Routing Failure of SCCP CL messages)
ITU Q.714 2.8:
"""
When an end node is informed of a routing failure, this information
is forwarded towards the SCCP user by using the N-DISCONNECT primitive
(refer to reason for release in 2.1.1.2.4/Q.711) or the N-NOTICE primitive
(refer to reason for return in 2.2.2.2.4/Q.711)
"""
We are already handling N-DISCONNECT.ind for CO messages, but
N-NOTICE.ind for CL messages was not being handled.
If CL messages are not arriving to the peer (MSC), then reset the link
and mark the peer as disconnected, until a new RESET can successfully fo
through.
Related: OS#5917
Change-Id: I3f6c120183a53a80255de71366935b6c07fcfbc8
---
M src/osmo-bsc/osmo_bsc_sigtran.c
1 file changed, 38 insertions(+), 1 deletion(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/06/40706/1
diff --git a/src/osmo-bsc/osmo_bsc_sigtran.c b/src/osmo-bsc/osmo_bsc_sigtran.c
index 0b48a02..3f97d36 100644
--- a/src/osmo-bsc/osmo_bsc_sigtran.c
+++ b/src/osmo-bsc/osmo_bsc_sigtran.c
@@ -1,4 +1,4 @@
-/* (C) 2017 by sysmocom s.f.m.c. GmbH, Author: Philipp Maier
+/* (C) 2017-2025 by sysmocom s.f.m.c. GmbH, Author: Philipp Maier
* (C) 2017-2018 by Harald Welte <laforge(a)gnumonks.org>
* All Rights Reserved
*
@@ -22,6 +22,7 @@
#include <osmocom/core/fsm.h>
#include <osmocom/sigtran/osmo_ss7.h>
#include <osmocom/sigtran/sccp_sap.h>
+#include <osmocom/sccp/sccp_types.h>
#include <osmocom/core/linuxlist.h>
#include <osmocom/gsm/gsm0808.h>
#include <osmocom/gsm/protocol/ipaccess.h>
@@ -157,6 +158,37 @@
return rc;
}
+static int handle_notice_ind(struct osmo_ss7_instance *cs7, const struct osmo_scu_notice_param *ni)
+{
+ int rc = 0;
+ struct bsc_msc_data *msc = get_msc_by_addr(&ni->calling_addr);
+ if (!msc) {
+ LOGP(DMSC, LOGL_DEBUG, "(calling_addr=%s) N-NOTICE.ind cause=%u='%s' importance=%u didn't match any MSC, ignoring\n",
+ osmo_sccp_addr_dump(&ni->calling_addr),
+ ni->cause, osmo_sccp_return_cause_name(ni->cause),
+ ni->importance);
+ return rc;
+ }
+
+ LOG_MSC(msc, LOGL_NOTICE, "(calling_addr=%s) N-NOTICE.ind cause=%u='%s' importance=%u\n",
+ osmo_sccp_addr_dump(&ni->calling_addr),
+ ni->cause, osmo_sccp_return_cause_name(ni->cause),
+ ni->importance);
+
+ switch (ni->cause) {
+ case SCCP_RETURN_CAUSE_SUBSYSTEM_CONGESTION:
+ case SCCP_RETURN_CAUSE_NETWORK_CONGESTION:
+ /* Transient failures (hopefully), keep going. */
+ return rc;
+ default:
+ /* continue below: */
+ }
+
+ /* Messages are not arriving to MSC. Kick the BSSMAP back to DISC state. */
+ bssmap_reset_set_disconnected(msc->a.bssmap_reset);
+ return rc;
+}
+
static int handle_n_connect_from_msc(struct osmo_sccp_user *scu, struct osmo_scu_prim *scu_prim)
{
struct bsc_msc_data *msc = get_msc_by_addr(&scu_prim->u.connect.calling_addr);
@@ -317,6 +349,11 @@
rc = handle_unitdata_from_msc(&scu_prim->u.unitdata.calling_addr, oph->msg, scu);
break;
+ case OSMO_PRIM(OSMO_SCU_PRIM_N_NOTICE, PRIM_OP_INDICATION):
+ DEBUGP(DMSC, "N-NOTICE.ind(%s)\n", osmo_hexdump(msgb_l2(oph->msg), msgb_l2len(oph->msg)));
+ rc = handle_notice_ind(osmo_sccp_get_ss7(sccp), &scu_prim->u.notice);
+ break;
+
case OSMO_PRIM(OSMO_SCU_PRIM_N_CONNECT, PRIM_OP_INDICATION):
/* Handle inbound connections */
DEBUGP(DMSC, "N-CONNECT.ind(X->%u)\n", scu_prim->u.connect.conn_id);
--
To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/40706?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: newchange
Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: I3f6c120183a53a80255de71366935b6c07fcfbc8
Gerrit-Change-Number: 40706
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Attention is currently required from: pespin.
Hoernchen has posted comments on this change by Hoernchen. ( https://gerrit.osmocom.org/c/osmo-ccid-firmware/+/40703?usp=email )
Change subject: 7816 fsm: ensure errors always return a msgb
......................................................................
Patch Set 1:
(1 comment)
File ccid_common/iso7816_fsm.c:
https://gerrit.osmocom.org/c/osmo-ccid-firmware/+/40703/comment/0db733ac_b5… :
PS1, Line 1510: OSMO_ASSERT(fi->fsm == &tpdu_fsm);
> this assert can still be kept? Or makes no sense?
checked by the function.
--
To view, visit https://gerrit.osmocom.org/c/osmo-ccid-firmware/+/40703?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: osmo-ccid-firmware
Gerrit-Branch: master
Gerrit-Change-Id: If32484675a0a10f1504477f5eea00c879ec78f1e
Gerrit-Change-Number: 40703
Gerrit-PatchSet: 1
Gerrit-Owner: Hoernchen <ewild(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-CC: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: pespin <pespin(a)sysmocom.de>
Gerrit-Comment-Date: Wed, 16 Jul 2025 14:29:04 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: pespin <pespin(a)sysmocom.de>
Attention is currently required from: Hoernchen.
pespin has posted comments on this change by Hoernchen. ( https://gerrit.osmocom.org/c/osmo-ccid-firmware/+/40703?usp=email )
Change subject: 7816 fsm: ensure errors always return a msgb
......................................................................
Patch Set 1:
(1 comment)
File ccid_common/iso7816_fsm.c:
https://gerrit.osmocom.org/c/osmo-ccid-firmware/+/40703/comment/483f9fe7_44… :
PS1, Line 1510: OSMO_ASSERT(fi->fsm == &tpdu_fsm);
this assert can still be kept? Or makes no sense?
--
To view, visit https://gerrit.osmocom.org/c/osmo-ccid-firmware/+/40703?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: osmo-ccid-firmware
Gerrit-Branch: master
Gerrit-Change-Id: If32484675a0a10f1504477f5eea00c879ec78f1e
Gerrit-Change-Number: 40703
Gerrit-PatchSet: 1
Gerrit-Owner: Hoernchen <ewild(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-CC: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: Hoernchen <ewild(a)sysmocom.de>
Gerrit-Comment-Date: Wed, 16 Jul 2025 14:10:46 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Hello Jenkins Builder,
I'd like you to reexamine a change. Please visit
https://gerrit.osmocom.org/c/libosmo-sigtran/+/40702?usp=email
to look at the new patch set (#2).
The following approvals got outdated and were removed:
Verified+1 by Jenkins Builder
Change subject: sccp_sclc: Remove SCCP cause mask in N-NOTICE.ind 'Reason for return' field
......................................................................
sccp_sclc: Remove SCCP cause mask in N-NOTICE.ind 'Reason for return' field
ITU Q.713 A.5 states "There is a one-to-one mapping between the return cause of
UDTS, XUDTS or LUDTS messages and the reason for return in the N-NOTICE
primitives".
This matches with the list of strings listed in ITU Q.711 6.2.2.2.4
"Reason for return".
"return cause" can in turn be found in ITU Q.713 3.12.
During sccp_sclc_rx_scrc_rout_fail(), we are encoding the "return cause"
param into the xua_msg usig gen_ret_msg(), which encodes it as SUA by
prepending the SUA_CAUSE_T_RETURN bitmask cause-type to it.
However, when constructing the primitive N-NOTICE.ind, we need to remove
that mask when filling in "Reason for return".
Change-Id: Iccff1e8809769edae36081a79119eb8da901841a
---
M include/osmocom/sigtran/sccp_sap.h
M src/sccp_sclc.c
2 files changed, 4 insertions(+), 2 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/libosmo-sigtran refs/changes/02/40702/2
--
To view, visit https://gerrit.osmocom.org/c/libosmo-sigtran/+/40702?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: newpatchset
Gerrit-Project: libosmo-sigtran
Gerrit-Branch: master
Gerrit-Change-Id: Iccff1e8809769edae36081a79119eb8da901841a
Gerrit-Change-Number: 40702
Gerrit-PatchSet: 2
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
pespin has submitted this change. ( https://gerrit.osmocom.org/c/libosmo-sigtran/+/40696?usp=email )
(
2 is the latest approved patch-set.
No files were changed between the latest approved patch-set and the submitted one.
)Change subject: xua_asp_fsm: Move helper function to ss7_asp internal API
......................................................................
xua_asp_fsm: Move helper function to ss7_asp internal API
This function will be used in other files in follow-up commit.
Change-Id: I3eb57c3fb690e7486b52b2c433b25930d16599e5
---
M src/ss7_asp.c
M src/ss7_asp.h
M src/xua_asp_fsm.c
3 files changed, 30 insertions(+), 28 deletions(-)
Approvals:
fixeria: Looks good to me, but someone else must approve
osmith: Looks good to me, approved
Jenkins Builder: Verified
diff --git a/src/ss7_asp.c b/src/ss7_asp.c
index 0fea556..7b819de 100644
--- a/src/ss7_asp.c
+++ b/src/ss7_asp.c
@@ -1549,3 +1549,30 @@
{
return _ss7_asp_get_all_rctx(asp, rctx, rctx_size, excl_as, false);
}
+
+/* determine the osmo_ss7_as_traffic_mode to be used by this ASP; will
+ * iterate over all AS configured for this ASP. If they're compatible,
+ * a single traffic mode is returned as enum osmo_ss7_as_traffic_mode.
+ * If they're incompatible, -EINVAL is returned. If there is none
+ * configured, -1 is returned */
+int ss7_asp_determine_traf_mode(const struct osmo_ss7_asp *asp)
+{
+ const struct osmo_ss7_as *as;
+ int tmode = -1;
+
+ llist_for_each_entry(as, &asp->inst->as_list, list) {
+ if (!osmo_ss7_as_has_asp(as, asp))
+ continue;
+ /* we only care about traffic modes explicitly set */
+ if (!as->cfg.mode_set_by_vty)
+ continue;
+ if (tmode == -1) {
+ /* this is the first AS; we use this traffic mode */
+ tmode = as->cfg.mode;
+ } else {
+ if (tmode != as->cfg.mode)
+ return -EINVAL;
+ }
+ }
+ return tmode;
+}
diff --git a/src/ss7_asp.h b/src/ss7_asp.h
index ec74e82..e25c85c 100644
--- a/src/ss7_asp.h
+++ b/src/ss7_asp.h
@@ -172,5 +172,7 @@
unsigned int ss7_asp_get_all_rctx_be(const struct osmo_ss7_asp *asp, uint32_t *rctx, unsigned int rctx_size,
const struct osmo_ss7_as *excl_as);
+int ss7_asp_determine_traf_mode(const struct osmo_ss7_asp *asp);
+
#define LOGPASP(asp, subsys, level, fmt, args ...) \
_LOGSS7((asp)->inst, subsys, level, "ASP(%s) " fmt, (asp)->cfg.name, ## args)
diff --git a/src/xua_asp_fsm.c b/src/xua_asp_fsm.c
index 8000839..c3a77da 100644
--- a/src/xua_asp_fsm.c
+++ b/src/xua_asp_fsm.c
@@ -195,33 +195,6 @@
talloc_free(aff_pc);
}
-/* determine the osmo_ss7_as_traffic_mode to be used by this ASP; will
- * iterate over all AS configured for this ASP. If they're compatible,
- * a single traffic mode is returned as enum osmo_ss7_as_traffic_mode.
- * If they're incompatible, -EINVAL is returned. If there is none
- * configured, -1 is returned */
-static int determine_traf_mode(struct osmo_ss7_asp *asp)
-{
- struct osmo_ss7_as *as;
- int tmode = -1;
-
- llist_for_each_entry(as, &asp->inst->as_list, list) {
- if (!osmo_ss7_as_has_asp(as, asp))
- continue;
- /* we only care about traffic modes explicitly set */
- if (!as->cfg.mode_set_by_vty)
- continue;
- if (tmode == -1) {
- /* this is the first AS; we use this traffic mode */
- tmode = as->cfg.mode;
- } else {
- if (tmode != as->cfg.mode)
- return -EINVAL;
- }
- }
- return tmode;
-}
-
/* add M3UA_IEI_ROUTE_CTX to xua_msg containig all routing keys of ASs within ASP */
static int xua_msg_add_asp_rctx(struct xua_msg *xua, struct osmo_ss7_asp *asp)
{
@@ -303,7 +276,7 @@
/* RFC3868 Ch. 3.6.1 */
xua->hdr = XUA_HDR(SUA_MSGC_ASPTM, SUA_ASPTM_ACTIVE);
/* Optional: Traffic Mode Type */
- rc = determine_traf_mode(asp);
+ rc = ss7_asp_determine_traf_mode(asp);
if (rc >= 0)
xua_msg_add_u32(xua, M3UA_IEI_TRAF_MODE_TYP, osmo_ss7_tmode_to_xua(rc));
/* Optional: Routing Context */
--
To view, visit https://gerrit.osmocom.org/c/libosmo-sigtran/+/40696?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: merged
Gerrit-Project: libosmo-sigtran
Gerrit-Branch: master
Gerrit-Change-Id: I3eb57c3fb690e7486b52b2c433b25930d16599e5
Gerrit-Change-Number: 40696
Gerrit-PatchSet: 3
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: osmith <osmith(a)sysmocom.de>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>