pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmo-sigtran/+/42119?usp=email )
Change subject: xua_asp_fsm: Validate remote ASP Id matching config in SG role
......................................................................
xua_asp_fsm: Validate remote ASP Id matching config in SG role
The node in SG role really doesn't have an ASP Id of its own (it is
never sent over the wire). Hence, use the "asp-identifier <N>" VTY
config in SG role to require the ASP to identift itself with a given
ASP identifier.
Related: OS#6953
Change-Id: I3e22439aa7e22f7a6113b093c44ace6745c808b9
---
M src/xua_asp_fsm.c
1 file changed, 27 insertions(+), 1 deletion(-)
git pull ssh://gerrit.osmocom.org:29418/libosmo-sigtran refs/changes/19/42119/1
diff --git a/src/xua_asp_fsm.c b/src/xua_asp_fsm.c
index b1bbec6..0ce2b41 100644
--- a/src/xua_asp_fsm.c
+++ b/src/xua_asp_fsm.c
@@ -577,15 +577,41 @@
case XUA_ASP_E_ASPSM_ASPUP:
ENSURE_SG_OR_IPSP(fi, event);
/* Optional ASP Identifier */
- if ((asp_id_ie = xua_msg_find_tag(data, SUA_IEI_ASP_ID))) {
+ asp_id_ie = xua_msg_find_tag(data, SUA_IEI_ASP_ID);
+
+ if (asp_id_ie) {
asp_id = xua_msg_part_get_u32(asp_id_ie);
if (!ss7_asp_check_remote_asp_id_unique(asp, asp_id)) {
peer_send_error(fi, M3UA_ERR_INVAL_ASP_ID);
return;
}
+ /* Expect specific ASP Id from ASP in SG role to match local config.
+ * In IPSP, each side can have its own local different ASP Identifier. */
+ if (asp->cfg.role == OSMO_SS7_ASP_ROLE_SG) {
+ if (asp->cfg.local_asp_id_present &&
+ asp->cfg.local_asp_id != asp_id) {
+ LOGPFSML(fi, LOGL_NOTICE, "ASPUP: Received asp_id %" PRIu32
+ " doesn't match configured 'asp-identifier %" PRIu32"'\n",
+ asp_id, asp->cfg.local_asp_id);
+ peer_send_error(fi, M3UA_ERR_INVAL_ASP_ID);
+ return;
+ }
+ }
/* Store for NTFY */
asp->remote_asp_id = asp_id;
asp->remote_asp_id_present = true;
+ } else if (asp->cfg.role == OSMO_SS7_ASP_ROLE_SG &&
+ asp->cfg.local_asp_id_present) {
+ /* If configured in role SG, expect the ASP to send us an ASP Identifier.
+ * RFC4666 3.8.1: 'The "ASP Identifier Required" error is sent by an SGP in
+ * response to an ASP Up message that does not contain an ASP Identifier
+ * parameter when the SGP requires one. The ASP SHOULD resend the ASP Up
+ * message with an ASP Identifier.'*/
+ LOGPFSML(fi, LOGL_NOTICE, "ASPUP: Received no asp_id "
+ "while expecting 'asp-identifier %" PRIu32"'\n",
+ asp->cfg.local_asp_id);
+ peer_send_error(fi, M3UA_ERR_ASP_ID_REQD);
+ return;
}
/* send ACK */
peer_send(fi, XUA_ASP_E_ASPSM_ASPUP_ACK, NULL);
--
To view, visit https://gerrit.osmocom.org/c/libosmo-sigtran/+/42119?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: newchange
Gerrit-Project: libosmo-sigtran
Gerrit-Branch: master
Gerrit-Change-Id: I3e22439aa7e22f7a6113b093c44ace6745c808b9
Gerrit-Change-Number: 42119
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Attention is currently required from: daniel.
pespin has posted comments on this change by pespin. ( https://gerrit.osmocom.org/c/libosmo-sigtran/+/42115?usp=email )
Change subject: Allow configuring local ASP Identifier
......................................................................
Patch Set 1:
(1 comment)
File src/ss7_asp_vty.c:
https://gerrit.osmocom.org/c/libosmo-sigtran/+/42115/comment/a2d9427d_47b74… :
PS1, Line 465: id64
> Change it to id or asp_id? […]
I specially wanted to name it that way because the var is signed 64 bits because the osmo_str_to_int64 requests it, while I actually need an uint32_t.
--
To view, visit https://gerrit.osmocom.org/c/libosmo-sigtran/+/42115?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: libosmo-sigtran
Gerrit-Branch: master
Gerrit-Change-Id: Ib94d542f940e13d5c007bc3319e7dde65cf81f12
Gerrit-Change-Number: 42115
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: daniel <dwillmann(a)sysmocom.de>
Gerrit-Attention: daniel <dwillmann(a)sysmocom.de>
Gerrit-Comment-Date: Thu, 12 Feb 2026 15:32:42 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: daniel <dwillmann(a)sysmocom.de>
Attention is currently required from: pespin.
daniel has posted comments on this change by pespin. ( https://gerrit.osmocom.org/c/libosmo-sigtran/+/42116?usp=email )
Change subject: xua_asp_fsm: Remove obvious comments
......................................................................
Patch Set 1: Code-Review+2
--
To view, visit https://gerrit.osmocom.org/c/libosmo-sigtran/+/42116?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: libosmo-sigtran
Gerrit-Branch: master
Gerrit-Change-Id: Idec06646c48fbce4cbe200e88f987dfb3e9d5a39
Gerrit-Change-Number: 42116
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: daniel <dwillmann(a)sysmocom.de>
Gerrit-Attention: pespin <pespin(a)sysmocom.de>
Gerrit-Comment-Date: Thu, 12 Feb 2026 15:32:10 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Attention is currently required from: pespin.
daniel has posted comments on this change by pespin. ( https://gerrit.osmocom.org/c/libosmo-sigtran/+/42115?usp=email )
Change subject: Allow configuring local ASP Identifier
......................................................................
Patch Set 1: Code-Review+1
(1 comment)
File src/ss7_asp_vty.c:
https://gerrit.osmocom.org/c/libosmo-sigtran/+/42115/comment/3eeac061_14c38… :
PS1, Line 465: id64
Change it to id or asp_id?
Maybe bike-shedding, but the only relation to 64 is that the function takes an int64_t. Even id32 would make more sense to show that it only holds values in that range.
--
To view, visit https://gerrit.osmocom.org/c/libosmo-sigtran/+/42115?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: libosmo-sigtran
Gerrit-Branch: master
Gerrit-Change-Id: Ib94d542f940e13d5c007bc3319e7dde65cf81f12
Gerrit-Change-Number: 42115
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: daniel <dwillmann(a)sysmocom.de>
Gerrit-Attention: pespin <pespin(a)sysmocom.de>
Gerrit-Comment-Date: Thu, 12 Feb 2026 15:31:19 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Attention is currently required from: daniel.
pespin has posted comments on this change by pespin. ( https://gerrit.osmocom.org/c/libosmo-sigtran/+/42114?usp=email )
Change subject: xua_as_fsm: Remove TODO no longer valid
......................................................................
Patch Set 1:
(1 comment)
File src/xua_as_fsm.c:
https://gerrit.osmocom.org/c/libosmo-sigtran/+/42114/comment/5424ce6f_4e55d… :
PS1, Line 139: npar->presence &= ~NOTIFY_PAR_P_ASP_ID;
> I know it's unrelated to your commit, but I *really* dislike mixed brace/no-brace blocks in if/else.
https://gerrit.osmocom.org/c/libosmo-sigtran/+/42118
--
To view, visit https://gerrit.osmocom.org/c/libosmo-sigtran/+/42114?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: libosmo-sigtran
Gerrit-Branch: master
Gerrit-Change-Id: I57af18dacc0470d36ddd4705a9530bd44b31f9c0
Gerrit-Change-Number: 42114
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: daniel <dwillmann(a)sysmocom.de>
Gerrit-Attention: daniel <dwillmann(a)sysmocom.de>
Gerrit-Comment-Date: Thu, 12 Feb 2026 15:23:42 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: daniel <dwillmann(a)sysmocom.de>