pespin has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/libosmo-sigtran/+/42072?usp=email )


Change subject: xua_rkm: Adapt RKM code to support IPSP
......................................................................

xua_rkm: Adapt RKM code to support IPSP

Related: OS#6474
Change-Id: I9c59d6fb43d4e7ceda552f156dd7761173545b11
---
M src/ss7_as_vty.c
M src/xua_rkm.c
2 files changed, 12 insertions(+), 11 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/libosmo-sigtran 
refs/changes/72/42072/1

diff --git a/src/ss7_as_vty.c b/src/ss7_as_vty.c
index 80359aa..f92b6d7 100644
--- a/src/ss7_as_vty.c
+++ b/src/ss7_as_vty.c
@@ -667,9 +667,9 @@
                * then announce using RKM.
                * Still, allow STPs to have AS(P) configured in an ASP mode to 
talk to a
                * peer STP by announcing remote PCs. */
-               if (as_role == OSMO_SS7_ASP_ROLE_ASP &&
+               if ((as_role == OSMO_SS7_ASP_ROLE_ASP || as_role == 
OSMO_SS7_ASP_ROLE_IPSP) &&
                    !osmo_ss7_pc_is_local(as->inst, as->cfg.routing_key.pc))
-                       vty_out(vty, "%% AS '%s' with local role ASP should 
have a local PC configured in its "
+                       vty_out(vty, "%% AS '%s' with local role ASP/IPSP 
should have a local PC configured in its "
                                "routing-key. Fix your config!%s", 
as->cfg.name, VTY_NEWLINE);

                if (as->cfg.proto == OSMO_SS7_ASP_PROT_IPA) {
diff --git a/src/xua_rkm.c b/src/xua_rkm.c
index 21591e9..22bcafe 100644
--- a/src/xua_rkm.c
+++ b/src/xua_rkm.c
@@ -219,16 +219,15 @@
                rctx, osmo_ss7_pointcode_print(asp->inst, dpc));

        /* We have two cases here:
-        * a) pre-configured routing context on both ASP and SG: We will
-        *    find the AS based on the RCTX send by the client, check if
-        *    the routing key matches, associated AS with ASP and return
-        *    success.
-        * b) no routing context set on ASP, no pre-existing AS
-        *    definition on SG.  We have to create the AS, set the RK,
+        * a) pre-configured routing context on both ASP and SG (or IPSP peers):
+        *    We will find the AS based on the RCTX send by the client, check if
+        *    the routing key matches, associated AS with ASP and return 
success.
+        * b) no routing context set on peer (ASP/IPSP), no pre-existing local 
AS
+        *    definition (SG/IPSP).  We have to create the AS, set the RK,
         *    allocate the RCTX and return that RCTX to the client. This
         *    is a slightly non-standard interpretation of M3UA RKM
-        *    which requires the SG to not have a-priori-knowledge of
-        *    all AS/RK in situations where the ASP are trusted.
+        *    which requires the SG/IPSP to not have a-priori-knowledge of
+        *    all AS/RK in situations where the peers are trusted.
         */

        /* check if there is already an AS for this routing key */
@@ -255,7 +254,9 @@
        if (as) {
                LOGPASP(asp, DLSS7, LOGL_NOTICE, "RKM: Found existing AS for 
RCTX %u\n", rctx);

-               if (as->cfg.routing_key.pc != dpc) {
+               /* In IPSP we expect in fact to have the local PC configured in 
routing-key. */
+               if (asp->cfg.role == OSMO_SS7_ASP_ROLE_SG &&
+                   as->cfg.routing_key.pc != dpc) {
                        LOGPASP(asp, DLSS7, LOGL_ERROR, "RKM: DPC doesn't 
match, rejecting AS (%u != %u)\n",
                                as->cfg.routing_key.pc, dpc);
                        msgb_append_reg_res(resp, rk_id, 
M3UA_RKM_REG_ERR_INVAL_RKEY, 0);

--
To view, visit https://gerrit.osmocom.org/c/libosmo-sigtran/+/42072?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: I9c59d6fb43d4e7ceda552f156dd7761173545b11
Gerrit-Change-Number: 42072
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <[email protected]>

Reply via email to