Attention is currently required from: n0k0.
Jenkins Builder has posted comments on this change by n0k0. ( https://gerrit.osmocom.org/c/libsmpp34/+/42889?usp=email )
Change subject: smpp34_unpack: bound C_OCTET scan with strnlen()
......................................................................
Patch Set 3:
(4 comments)
File src/smpp34_unpack.c:
Robot Comment from checkpatch (run ID ):
https://gerrit.osmocom.org/c/libsmpp34/+/42889/comment/3b97a1da_50a2fe14?us… :
PS3, Line 130: lenval = strnlen( (char*) aux, left ) + 1;\
please, no spaces at the start of a line
Robot Comment from checkpatch (run ID ):
https://gerrit.osmocom.org/c/libsmpp34/+/42889/comment/ccecbba5_d7b99fc2?us… :
PS3, Line 130: lenval = strnlen( (char*) aux, left ) + 1;\
"(foo*)" should be "(foo *)"
Robot Comment from checkpatch (run ID ):
https://gerrit.osmocom.org/c/libsmpp34/+/42889/comment/0499e315_db184520?us… :
PS3, Line 130: lenval = strnlen( (char*) aux, left ) + 1;\
space prohibited after that open parenthesis '('
Robot Comment from checkpatch (run ID ):
https://gerrit.osmocom.org/c/libsmpp34/+/42889/comment/8fc592ab_6a081a5f?us… :
PS3, Line 130: lenval = strnlen( (char*) aux, left ) + 1;\
space prohibited before that close parenthesis ')'
--
To view, visit https://gerrit.osmocom.org/c/libsmpp34/+/42889?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: libsmpp34
Gerrit-Branch: master
Gerrit-Change-Id: Ie87b16cad0dbdc8ea8397c1b065b8545f23ac814
Gerrit-Change-Number: 42889
Gerrit-PatchSet: 3
Gerrit-Owner: n0k0 <osmocom(a)hacky.software>
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-CC: Jenkins Builder
Gerrit-Attention: n0k0 <osmocom(a)hacky.software>
Gerrit-Comment-Date: Wed, 12 Aug 2026 11:42:54 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Attention is currently required from: dexter, jolly.
laforge has posted comments on this change by jolly. ( https://gerrit.osmocom.org/c/onomondo-ipa/+/43202?usp=email )
Change subject: Introduce 'operation' option to main file
......................................................................
Patch Set 2: -Code-Review
(1 comment)
File src/ipa/main.c:
https://gerrit.osmocom.org/c/onomondo-ipa/+/43202/comment/8d3938b5_3f7acb32… :
PS2, Line 193: break;
I think this change is only half-done.
Let's please also introduce an enum for the operation, and have one global variable with that enum type, initialized to the default mode. The main body after the getopt-while-loop then consists mainly of a single switch statement based on the mode.
--
To view, visit https://gerrit.osmocom.org/c/onomondo-ipa/+/43202?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: onomondo-ipa
Gerrit-Branch: master
Gerrit-Change-Id: I6b960f840820990de40fb07332669ddbfcdf1e7d
Gerrit-Change-Number: 43202
Gerrit-PatchSet: 2
Gerrit-Owner: jolly <andreas(a)eversberg.eu>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: dexter <pmaier(a)sysmocom.de>
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Attention: jolly <andreas(a)eversberg.eu>
Gerrit-Attention: dexter <pmaier(a)sysmocom.de>
Gerrit-Comment-Date: Wed, 12 Aug 2026 11:40:04 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Attention is currently required from: laforge, lynxis lazus.
dexter has posted comments on this change by lynxis lazus. ( https://gerrit.osmocom.org/c/simtrace2/+/43185?usp=email )
Change subject: Add osmo_apdu_segment_in2() to ensure correct parsing of GP GET DATA
......................................................................
Patch Set 3: Code-Review+1
(10 comments)
Patchset:
PS3:
I have looked through your patch. Unfortunately I do not have the big picture, but the problem you describe and the solution appears to make sense.
As far as I understand the problem is that the information about the original APDU case gets lost and this later causes problems when forwarding it. That is why you transfer the prev_ac->apdu_case to ac->apdu_case.
Where I am a bit lost is to understand the difference between ETSI TS 102 221, Table 7.1 and GlobalPlatform A.1. They both apparently perform the re-send in the same manner. Maybe this corner case is more generic than originally assumed. You may also have a look [1], maybe this is helpful.
[1] https://gitea.osmocom.org/sim-card/pysim/src/branch/master/pySim/transport/…
Commit Message:
https://gerrit.osmocom.org/c/simtrace2/+/43185/comment/6e023419_0d59277c?us… :
PS3, Line 9: osmo_apdu_segment_in() don't have the context of the previous APDU,
don't => does not
https://gerrit.osmocom.org/c/simtrace2/+/43185/comment/b8040acd_06f148ee?us… :
PS3, Line 12: GP GET DATA defines the Le field as 0x00 which is used to detect if this
this => it
https://gerrit.osmocom.org/c/simtrace2/+/43185/comment/0606454e_310fc93b?us… :
PS3, Line 17: instead of a case 2 with Le != 0.
I am having difficulties to understand this description. After responding we cannot go back and manipulated the Le field, we would have to go back in time. Which we cannot. Do you mean prev_ac with that. Or do you wanted to write ".. the following GP GET DATA ..."?
File host/lib/apdu_dispatch.c:
https://gerrit.osmocom.org/c/simtrace2/+/43185/comment/177859c7_811fa7c0?us… :
PS3, Line 86: * \param prev_ac Previous APDU context across successive calls
ac and prev_ac are [inout], right? (its probably not necessary to explicitly mark inout parameter in doxygen...)
https://gerrit.osmocom.org/c/simtrace2/+/43185/comment/00bf6a02_a1d0661d?us… :
PS3, Line 120: ac->hdr.cla & 0x80 && /* check for GP */
In GlobalPlatform Card Specification, section 11.3.2 they list more possible CLA bytes. Those are probably not relevant for our usecase. I also have only seen 0x80 so far.
File host/tests/apdu_dispatch/apdu_dispatch_test.c:
https://gerrit.osmocom.org/c/simtrace2/+/43185/comment/5ebb424a_830ea41f?us… :
PS3, Line 18: memset(&prev_ac, 0, sizeof(prev_ac)); \
prev_ac only appears in the memset and nowhere else, is this line needed in this macro?
https://gerrit.osmocom.org/c/simtrace2/+/43185/comment/c6612c0b_67103fa9?us… :
PS3, Line 22: printf("%d (actual) != %d (intended)\n", rc, exp_rc);\
I think (expected) is more accurate. The variable is also called "exp_rc".
https://gerrit.osmocom.org/c/simtrace2/+/43185/comment/cc45f40d_9d1f2fc4?us… :
PS3, Line 55: rc = osmo_apdu_segment_in2(&ac, &prev_ac, get_data_c2_ca, ARRAY_SIZE(get_data_c2_ca), 1);
The last parameter of osmo_apdu_segment_in2 is a bool. Maybe it is better to pass true instead of 1 then. Its the same, but easier to read.
https://gerrit.osmocom.org/c/simtrace2/+/43185/comment/30c364ec_cb77aaaf?us… :
PS3, Line 70: OSMO_ASSERT(rc == APDU_ACT_TX_CAPDU_TO_CARD);
I wonder if it would make sense to inspect the contents of ac and prev_ac after osmo_apdu_segment_in2 was called.
--
To view, visit https://gerrit.osmocom.org/c/simtrace2/+/43185?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: simtrace2
Gerrit-Branch: master
Gerrit-Change-Id: Ie238662e7e6a10dd4283ede0c8d8d73bc375c247
Gerrit-Change-Number: 43185
Gerrit-PatchSet: 3
Gerrit-Owner: lynxis lazus <lynxis(a)fe80.eu>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: dexter <pmaier(a)sysmocom.de>
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Attention: laforge <laforge(a)osmocom.org>
Gerrit-Attention: lynxis lazus <lynxis(a)fe80.eu>
Gerrit-Comment-Date: Wed, 12 Aug 2026 11:03:55 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
laforge has submitted this change. ( https://gerrit.osmocom.org/c/libosmo-sigtran/+/43193?usp=email )
Change subject: TCAP: UDTS routing: stop overwriting ASP when routing UDTS
......................................................................
TCAP: UDTS routing: stop overwriting ASP when routing UDTS
The UDTS routing decision is final and should not go to the tcap routing
a second time as a normal packet.
Change-Id: I1c4eaaf352d505970e55e04c605c100d64aaaa34
---
M src/tcap_as_loadshare.c
1 file changed, 2 insertions(+), 0 deletions(-)
Approvals:
pespin: Looks good to me, approved
laforge: Looks good to me, but someone else must approve
Jenkins Builder: Verified
diff --git a/src/tcap_as_loadshare.c b/src/tcap_as_loadshare.c
index 8cc32d6..b699281 100644
--- a/src/tcap_as_loadshare.c
+++ b/src/tcap_as_loadshare.c
@@ -614,6 +614,8 @@
asp = tcap_as_asp_find_by_tcap_id(as, &called_addr, &calling_addr, *otid);
if (!asp)
LOGPAS(as, DLTCAP, LOGL_NOTICE, "Could not find an ASP for UDTS with otid %u/dtid %u\n", parsed.otid, parsed.dtid);
+
+ goto out_free_sua;
}
/* TCAP messages towards the IPA nodes */
--
To view, visit https://gerrit.osmocom.org/c/libosmo-sigtran/+/43193?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: I1c4eaaf352d505970e55e04c605c100d64aaaa34
Gerrit-Change-Number: 43193
Gerrit-PatchSet: 7
Gerrit-Owner: lynxis lazus <lynxis(a)fe80.eu>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: daniel <dwillmann(a)sysmocom.de>
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
laforge has submitted this change. ( https://gerrit.osmocom.org/c/libosmo-sigtran/+/43007?usp=email )
Change subject: TCAP: Refactoring unroutable messages into own function
......................................................................
TCAP: Refactoring unroutable messages into own function
In preparation of adding another method to handle those.
Change-Id: Ib4d114273423730418458767d17b11de9bd815d4
---
M src/tcap_as_loadshare.c
1 file changed, 65 insertions(+), 12 deletions(-)
Approvals:
pespin: Looks good to me, approved
Jenkins Builder: Verified
diff --git a/src/tcap_as_loadshare.c b/src/tcap_as_loadshare.c
index 058e0c3..a24d56e 100644
--- a/src/tcap_as_loadshare.c
+++ b/src/tcap_as_loadshare.c
@@ -454,6 +454,42 @@
return rc;
}
+/*! When a TCAP MSU from an ongoing session (TCAP != Begin) could not be routed either by the TCAP session tracking or
+ * by the TID range, such messages will be passed to this function.
+ *
+ * \param[out] rasp the new ASP where the TCAP MSU should be send out (can be NULL)
+ * \param[in] as the AS to which this MSU was routed to
+ * \param[in] mtp
+ * \param[in] sccp_msg
+ * \return 0 on success
+ */
+static int asp_loadshare_tcap_handle_unroutable(struct osmo_ss7_asp **rasp,
+ struct osmo_ss7_as *as,
+ const struct osmo_mtp_transfer_param *mtp,
+ const struct msgb *sccp_msg)
+{
+ struct osmo_ss7_asp *asp = NULL;
+ int rc = -ENOKEY;
+
+ OSMO_ASSERT(rasp);
+
+ switch (as->cfg.loadshare.tcap.unroutable_tcap_msg) {
+ case SS7_AS_TCAP_UNROUTABLE_LOAD_SHARE_AS:
+ asp = select_asp_tcap_enabled_rr(as);
+ if (asp)
+ rc = 0;
+ break;
+ case SS7_AS_TCAP_UNROUTABLE_REJECT_UDTS:
+ default:
+ /* default case, asp stays NULL, will reject when returning -ENOKEY */
+ rc = -ENOKEY;
+ break;
+ }
+
+ *rasp = asp;
+ return rc;
+}
+
/*! Traffic STP -> AS -> ASP (Tx path) Loadshare towards the TCAP routing AS
*
* \param[out] rasp the selected ASP if any, can be NULL
@@ -582,16 +618,24 @@
LOGPAS(as, DLTCAP, LOGL_INFO, "Couldn't find cached ASP for TCAP Continue, dtid %u/otid %u, using tcap route", parsed.dtid, parsed.otid);
rate_ctr_inc2(as->ctrg, SS7_AS_CTR_TCAP_ASP_MISS);
asp = tcap_as_asp_find_by_tcap_id(as, &calling_addr, &called_addr, parsed.dtid);
- if (!asp && as->cfg.loadshare.tcap.unroutable_tcap_msg == SS7_AS_TCAP_UNROUTABLE_LOAD_SHARE_AS) {
- asp = select_asp_tcap_enabled_rr(as);
- if (asp)
- rate_ctr_inc2(as->ctrg, SS7_AS_CTR_TCAP_ASP_FALLBACK);
+ if (!asp) {
+ /* Couldn't find a matching TCAP endpoint for an ongoing session */
+ rc = asp_loadshare_tcap_handle_unroutable(&asp, as, mtp, sccp_msg);
+ if (rc)
+ goto out_free_sua;
+
+ if (!asp) {
+ rc = -ENOKEY;
+ goto out_free_sua;
+ }
+
+ rate_ctr_inc2(as->ctrg, SS7_AS_CTR_TCAP_ASP_FALLBACK);
}
- if (asp)
- tcap_trans_track_entry_create(as, asp, &called_addr, &parsed.dtid, &calling_addr, &parsed.otid);
+ tcap_trans_track_entry_create(as, asp, &called_addr, &parsed.dtid, &calling_addr, &parsed.otid);
}
- rc = asp ? 0 : -ENOKEY;
+
+ rc = 0;
break;
case TCAP_TCMessage_PR_abort:
case TCAP_TCMessage_PR_end:
@@ -606,14 +650,23 @@
LOGPAS(as, DLTCAP, LOGL_INFO, "Couldn't find cached ASP for TCAP End, dtid %u, using tcap route\n", parsed.dtid);
rate_ctr_inc2(as->ctrg, SS7_AS_CTR_TCAP_ASP_MISS);
asp = tcap_as_asp_find_by_tcap_id(as, &calling_addr, &called_addr, parsed.dtid);
- if (!asp && as->cfg.loadshare.tcap.unroutable_tcap_msg == SS7_AS_TCAP_UNROUTABLE_LOAD_SHARE_AS) {
- asp = select_asp_tcap_enabled_rr(as);
- if (asp)
- rate_ctr_inc2(as->ctrg, SS7_AS_CTR_TCAP_ASP_FALLBACK);
+ if (!asp) {
+ /* Couldn't find a matching TCAP endpoint for an ongoing session */
+ rc = asp_loadshare_tcap_handle_unroutable(&asp, as, mtp, sccp_msg);
+ if (rc)
+ goto out_free_sua;
+
+ if (!asp) {
+ rc = -ENOKEY;
+ goto out_free_sua;
+ }
+
+ rate_ctr_inc2(as->ctrg, SS7_AS_CTR_TCAP_ASP_FALLBACK);
}
/* Don't create an entry for an End */
}
- rc = asp ? 0 : -ENOKEY;
+
+ rc = 0;
break;
case TCAP_TCMessage_PR_unidirectional:
case TCAP_TCMessage_PR_NOTHING:
--
To view, visit https://gerrit.osmocom.org/c/libosmo-sigtran/+/43007?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: Ib4d114273423730418458767d17b11de9bd815d4
Gerrit-Change-Number: 43007
Gerrit-PatchSet: 5
Gerrit-Owner: lynxis lazus <lynxis(a)fe80.eu>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: daniel <dwillmann(a)sysmocom.de>
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
laforge has submitted this change. ( https://gerrit.osmocom.org/c/libosmo-sigtran/+/43008?usp=email )
Change subject: TCAP: implement fallback routing when no TCAP ASP can be found.
......................................................................
TCAP: implement fallback routing when no TCAP ASP can be found.
If a TCAP message from an ongoing session can't be routed by
either the TCAP session cache or by the destination TID to a known
ASP, allow to route the packet to a different destination.
Change-Id: I3e4e634b38a1845c2ce62a3805ff91a530520d88
---
M src/ss7_as.c
M src/ss7_as.h
M src/ss7_as_vty.c
M src/tcap_as_loadshare.c
M tests/vty/osmo_stp_test_tcap.vty
5 files changed, 78 insertions(+), 12 deletions(-)
Approvals:
pespin: Looks good to me, approved
Jenkins Builder: Verified
diff --git a/src/ss7_as.c b/src/ss7_as.c
index 064ea4f..fe236cf 100644
--- a/src/ss7_as.c
+++ b/src/ss7_as.c
@@ -94,8 +94,9 @@
};
struct value_string osmo_ss7_as_tcap_unroutable_vals[] = {
- { SS7_AS_TCAP_UNROUTABLE_REJECT_UDTS, "reject-udts" },
- { SS7_AS_TCAP_UNROUTABLE_LOAD_SHARE_AS, "load-share-over-as" },
+ { SS7_AS_TCAP_UNROUTABLE_REJECT_UDTS, "reject-udts" },
+ { SS7_AS_TCAP_UNROUTABLE_LOAD_SHARE_AS, "load-share-over-as" },
+ { SS7_AS_TCAP_UNROUTABLE_ROUTE_FALLBACK, "route-fallback" },
{ 0, NULL }
};
diff --git a/src/ss7_as.h b/src/ss7_as.h
index 7d873b8..3d36102 100644
--- a/src/ss7_as.h
+++ b/src/ss7_as.h
@@ -75,11 +75,12 @@
#endif /* WITH_TCAP_LOADSHARING */
};
-/* when receiving an TCAP Continue/End/Abort which can't be assosiated to a node (either by sesssion tracking or by DTID over TCAP ranges,
+/* when receiving an TCAP Continue/End/Abort which can't be associated to a node (either by sesssion tracking or by DTID over TCAP ranges,
* how to handle those */
enum ss7_as_tcap_unroutable {
SS7_AS_TCAP_UNROUTABLE_REJECT_UDTS, /*! reject the unroutable TCAP message with a UDTS */
SS7_AS_TCAP_UNROUTABLE_LOAD_SHARE_AS, /*! fallback to round robin load-share over all available ASP */
+ SS7_AS_TCAP_UNROUTABLE_ROUTE_FALLBACK, /*! route to a different destination */
};
extern struct value_string osmo_ss7_as_tcap_unroutable_vals[];
@@ -181,6 +182,8 @@
bool enabled;
unsigned int timeout_s;
enum ss7_as_tcap_unroutable unroutable_tcap_msg;
+ /* when unroutable_tcap_msg == SS7_AS_TCPA_UNROUTABLE_ROUTE_FALLBACK, replace DPC with this */
+ uint32_t unroutable_tcap_fallback_dpc;
} tcap;
#endif /* WITH_TCAP_LOADSHARING */
} loadshare;
diff --git a/src/ss7_as_vty.c b/src/ss7_as_vty.c
index 0370f2f..4d7d460 100644
--- a/src/ss7_as_vty.c
+++ b/src/ss7_as_vty.c
@@ -249,9 +249,10 @@
DEFUN_USRATTR(as_tcap_unroutable_sessions, as_tcap_unroutable_sessions_cmd,
OSMO_SCCP_LIB_ATTR_RSTRT_ASP,
"tcap-unroutable-sessions (reject-udts | load-share-over-as)",
- "When receiving a TCAP Continue/End/Abort message where no ASP can be assosiated (either via session tracking or by TCAP range for dtid). How should this message handled.\n"
+ "When receiving a TCAP Continue/End/Abort message where no ASP can be associated (either via session tracking or by TCAP range for dtid). How should this message be handled.\n"
"Reject the message with a UDTS\n"
- "Fallback to load-share over AS by using all available AS (round robin)\n")
+ "Fallback to load-share over AS by using all available AS (round robin)\n"
+ "Route to a different M3UA PC\n")
{
struct osmo_ss7_as *as = vty->index;
int value = get_string_value(osmo_ss7_as_tcap_unroutable_vals, argv[0]);
@@ -261,6 +262,25 @@
as->cfg.loadshare.tcap.unroutable_tcap_msg = value;
return CMD_SUCCESS;
}
+
+DEFUN_USRATTR(as_tcap_unroutable_sessions_fallback, as_tcap_unroutable_sessions_fallback_cmd,
+ OSMO_SCCP_LIB_ATTR_RSTRT_ASP,
+ "tcap-unroutable-sessions route-fallback DPC",
+ "When receiving a TCAP Continue/End/Abort message where no ASP can be associated (either via session tracking or by TCAP range for dtid). How should this message be handled.\n"
+ "Route to a different M3UA PC\n"
+ "Destination Point Code\n")
+{
+ struct osmo_ss7_as *as = vty->index;
+ int pc = osmo_ss7_pointcode_parse(as->inst, argv[0]);
+ if (pc < 0) {
+ vty_out(vty, "Invalid point code (%s)%s", argv[0], VTY_NEWLINE);
+ return CMD_WARNING;
+ }
+
+ as->cfg.loadshare.tcap.unroutable_tcap_msg = SS7_AS_TCAP_UNROUTABLE_ROUTE_FALLBACK;
+ as->cfg.loadshare.tcap.unroutable_tcap_fallback_dpc = pc;
+ return CMD_SUCCESS;
+}
#endif /* WITH_TCAP_LOADSHARING */
DEFUN_ATTR(as_bindingtable_reset, as_bindingtable_reset_cmd,
@@ -524,12 +544,23 @@
if (as->cfg.loadshare.tcap.enabled)
vty_out(vty, " tcap-routing%s", VTY_NEWLINE);
- if (as->cfg.loadshare.tcap.unroutable_tcap_msg != SS7_AS_TCAP_UNROUTABLE_REJECT_UDTS) {
- const char *str = get_value_string_or_null(osmo_ss7_as_tcap_unroutable_vals,
- as->cfg.loadshare.tcap.unroutable_tcap_msg);
- if (str)
- vty_out(vty, " tcap-unroutable-sessions %s%s", str, VTY_NEWLINE);
+ const char *tcap_unroutable_str = get_value_string_or_null(osmo_ss7_as_tcap_unroutable_vals,
+ as->cfg.loadshare.tcap.unroutable_tcap_msg);
+ switch (as->cfg.loadshare.tcap.unroutable_tcap_msg) {
+ case SS7_AS_TCAP_UNROUTABLE_REJECT_UDTS:
+ /* default value, no need to write it out */
+ break;
+ case SS7_AS_TCAP_UNROUTABLE_ROUTE_FALLBACK:
+ vty_out(vty, " tcap-route-fallback %s%s%s", tcap_unroutable_str,
+ osmo_ss7_pointcode_print(as->inst, as->cfg.loadshare.tcap.unroutable_tcap_fallback_dpc),
+ VTY_NEWLINE);
+ break;
+ case SS7_AS_TCAP_UNROUTABLE_LOAD_SHARE_AS:
+ vty_out(vty, " tcap-route-fallback %s%s", tcap_unroutable_str, VTY_NEWLINE);
+ default:
+ break;
}
+
#endif /* WITH_TCAP_LOADSHARING */
if (as->cfg.recovery_timeout_msec != 2000) {
@@ -738,6 +769,7 @@
install_lib_element(L_CS7_AS_NODE, &as_tcap_routing_cmd);
install_lib_element(L_CS7_AS_NODE, &as_no_tcap_routing_cmd);
install_lib_element(L_CS7_AS_NODE, &as_tcap_unroutable_sessions_cmd);
+ install_lib_element(L_CS7_AS_NODE, &as_tcap_unroutable_sessions_fallback_cmd);
}
#endif /* WITH_TCAP_LOADSHARING */
install_lib_element(L_CS7_AS_NODE, &as_bindingtable_reset_cmd);
diff --git a/src/tcap_as_loadshare.c b/src/tcap_as_loadshare.c
index a24d56e..8cc32d6 100644
--- a/src/tcap_as_loadshare.c
+++ b/src/tcap_as_loadshare.c
@@ -454,6 +454,30 @@
return rc;
}
+/*! When a TCAP message can't be routed by TID or session cache and
+ * unroutable_tcap_msg == SS7_AS_TCPA_UNROUTABLE_ROUTE_FALLBACK, route to a different DPC.
+ *
+ * \param[in] as
+ * \param[in] mtp MTP routing information
+ * \param[in] sccp_msg the SCCP message.
+ * \return 0 on success or -ENOKEY
+ */
+static int asp_loadshare_tcap_route_fallback(struct osmo_ss7_as *as,
+ const struct osmo_mtp_transfer_param *orig_mtp,
+ const struct msgb *sccp_msg)
+{
+ struct osmo_mtp_transfer_param new_mtp = *orig_mtp;
+ int rc = 0;
+ new_mtp.dpc = as->cfg.loadshare.tcap.unroutable_tcap_fallback_dpc;
+
+ /* l2 contains the sccp message */
+ rc = mtp3_hmrt_mtp_xfer_request_l4_to_l3(as->inst, &new_mtp, msgb_l2(sccp_msg), msgb_l2len(sccp_msg));
+ if (!rc)
+ return -ENOKEY;
+
+ return 0;
+}
+
/*! When a TCAP MSU from an ongoing session (TCAP != Begin) could not be routed either by the TCAP session tracking or
* by the TID range, such messages will be passed to this function.
*
@@ -461,7 +485,7 @@
* \param[in] as the AS to which this MSU was routed to
* \param[in] mtp
* \param[in] sccp_msg
- * \return 0 on success
+ * \return 0 on success and asp is set, < 0 on error, > 0 when message is routed elsewhere
*/
static int asp_loadshare_tcap_handle_unroutable(struct osmo_ss7_asp **rasp,
struct osmo_ss7_as *as,
@@ -479,6 +503,12 @@
if (asp)
rc = 0;
break;
+ case SS7_AS_TCAP_UNROUTABLE_ROUTE_FALLBACK:
+ /* No ASP selection. Try to route the SCCP msg to the fallback DPC */
+ rc = asp_loadshare_tcap_route_fallback(as, mtp, sccp_msg);
+ if (!rc) /* rc == 0 would require a valid asp, use > 0 to drop the msg, but don't send an error back if needed */
+ rc = 1;
+ break;
case SS7_AS_TCAP_UNROUTABLE_REJECT_UDTS:
default:
/* default case, asp stays NULL, will reject when returning -ENOKEY */
diff --git a/tests/vty/osmo_stp_test_tcap.vty b/tests/vty/osmo_stp_test_tcap.vty
index 7ffff77..d32c237 100644
--- a/tests/vty/osmo_stp_test_tcap.vty
+++ b/tests/vty/osmo_stp_test_tcap.vty
@@ -34,7 +34,7 @@
traffic-mode Specifies traffic mode of operation of the ASP within the AS
sls-shift Shift SLS bits used during routing decision
tcap-routing Enable TCAP-based routing when in traffic-mode loadshare
- tcap-unroutable-sessions When receiving a TCAP Continue/End/Abort message where no ASP can be assosiated (either via session tracking or by TCAP range for dtid). How should this message handled.
+ tcap-unroutable-sessions When receiving a TCAP Continue/End/Abort message where no ASP can be associated (either via session tracking or by TCAP range for dtid). How should this message be handled.
binding-table AS Loadshare binding table operations
recovery-timeout Specifies RFC4666 recovery timer T(r) timeout
qos-class Specity QoS Class of AS
--
To view, visit https://gerrit.osmocom.org/c/libosmo-sigtran/+/43008?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: I3e4e634b38a1845c2ce62a3805ff91a530520d88
Gerrit-Change-Number: 43008
Gerrit-PatchSet: 9
Gerrit-Owner: lynxis lazus <lynxis(a)fe80.eu>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: daniel <dwillmann(a)sysmocom.de>
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
laforge has submitted this change. ( https://gerrit.osmocom.org/c/osmo-ci/+/43206?usp=email )
Change subject: ansible: obsworker: restart on failure
......................................................................
ansible: obsworker: restart on failure
The obsworker service can fail if it can't reach the OBS server after it
started. Let it retry continuously until the server comes up again.
As the original service is of type "oneshot", Restart=on-failure must be
used instead of Restart=always (https://unix.stackexchange.com/a/777329).
Change-Id: I81fe02984d6c227a482b0b2421a967def1e208d5
---
A ansible/roles/osmocom-obs-worker/files/obsworker.conf
M ansible/roles/osmocom-obs-worker/tasks/obs.yml
2 files changed, 12 insertions(+), 0 deletions(-)
Approvals:
Jenkins Builder: Verified
laforge: Looks good to me, approved
diff --git a/ansible/roles/osmocom-obs-worker/files/obsworker.conf b/ansible/roles/osmocom-obs-worker/files/obsworker.conf
new file mode 100644
index 0000000..cb9a4dd
--- /dev/null
+++ b/ansible/roles/osmocom-obs-worker/files/obsworker.conf
@@ -0,0 +1,3 @@
+[Service]
+Restart=on-failure
+RestartSec=10
diff --git a/ansible/roles/osmocom-obs-worker/tasks/obs.yml b/ansible/roles/osmocom-obs-worker/tasks/obs.yml
index 48024ec..f13195a 100644
--- a/ansible/roles/osmocom-obs-worker/tasks/obs.yml
+++ b/ansible/roles/osmocom-obs-worker/tasks/obs.yml
@@ -58,6 +58,15 @@
name: mount-securityfs.service
enabled: yes
+- name: create /etc/systemd/system/obsworker.service.d/
+ file:
+ path: /etc/systemd/system/obsworker.service.d/
+
+- name: configure systemd service to restart on failure
+ ansible.builtin.copy:
+ src: obsworker.conf
+ dest: /etc/systemd/system/obsworker.service.d/override.conf
+
- name: ensure the systemd service is installed
systemd:
name: obsworker.service
--
To view, visit https://gerrit.osmocom.org/c/osmo-ci/+/43206?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: merged
Gerrit-Project: osmo-ci
Gerrit-Branch: master
Gerrit-Change-Id: I81fe02984d6c227a482b0b2421a967def1e208d5
Gerrit-Change-Number: 43206
Gerrit-PatchSet: 1
Gerrit-Owner: osmith <osmith(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>