pespin has submitted this change. ( 
https://gerrit.osmocom.org/c/libosmo-sigtran/+/40579?usp=email )

Change subject: ss7_vty: Avoid adding route to local PC in role ASP
......................................................................

ss7_vty: Avoid adding route to local PC in role ASP

This commit basically reverts b4f1b2cb8bd404f08601dc8ca700b672a455846c
from ~4 years ago.

In ASP role, the routing-key is configured with a local PC, since that's
what's announced during RKM towards the SG.
Hence, it makes no sense adding a route pointing to a local PCm because
the M3UA routing decisions first check if the DPC is local, and only then
otherwise tries to route it.

Change-Id: Ic602de42e37c4579f530823bb41e0a8193ce73bb
---
M src/ss7_as_vty.c
M src/ss7_vty.c
M src/ss7_vty.h
3 files changed, 1 insertion(+), 25 deletions(-)

Approvals:
  laforge: Looks good to me, but someone else must approve
  Jenkins Builder: Verified
  osmith: Looks good to me, but someone else must approve
  daniel: Looks good to me, but someone else must approve
  pespin: Looks good to me, approved




diff --git a/src/ss7_as_vty.c b/src/ss7_as_vty.c
index 6ea170e..0b0ddc1 100644
--- a/src/ss7_as_vty.c
+++ b/src/ss7_as_vty.c
@@ -288,7 +288,6 @@
 {
        struct osmo_ss7_as *as = vty->index;
        struct osmo_ss7_routing_key *rkey = &as->cfg.routing_key;
-       struct osmo_ss7_route *rt;
        int pc;

        if (as->cfg.proto == OSMO_SS7_ASP_PROT_IPA && atoi(rcontext) != 0) {
@@ -303,34 +302,12 @@
                return CMD_WARNING;
        }

-       /* When libosmo-sigtran is used in ASP role, the VTY routing table node
-        * (config-cs7-rt) is not available. However, when we add a routing key
-        * to an AS we still have to put a matching dynamic route into the 
routing
-        * table. This is done automatically by first removing the old dynamic 
route
-        * (users may change the routing key via VTY during runtime) and then
-        * putting a new dynamic route (see below). */
-       if (cs7_role == CS7_ROLE_ASP) {
-               rt = 
ss7_route_table_find_route_by_dpc_mask(as->inst->rtable_system,
-                                                           rkey->pc, 0xffffff,
-                                                           true);
-               if (rt)
-                       ss7_route_destroy(rt);
-       }
-
        rkey->pc = pc;

        rkey->context = atoi(rcontext);                         /* FIXME: input 
validation */
        rkey->si = si ? get_string_value(mtp_si_vals, si) : 0;  /* FIXME: input 
validation */
        rkey->ssn = ssn ? atoi(ssn) : 0;                        /* FIXME: input 
validation */

-       /* automatically add new dynamic route (see also comment above) */
-       if (cs7_role == CS7_ROLE_ASP) {
-               if (!ss7_route_create(as->inst->rtable_system, rkey->pc, 
0xffffff, true, as->cfg.name)) {
-                       vty_out(vty, "Cannot create route (pc=%s, linkset=%s) 
to AS %s", dpc, as->cfg.name, VTY_NEWLINE);
-                       return CMD_WARNING;
-               }
-       }
-
        return CMD_SUCCESS;
 }

diff --git a/src/ss7_vty.c b/src/ss7_vty.c
index 9916185..a8869d4 100644
--- a/src/ss7_vty.c
+++ b/src/ss7_vty.c
@@ -75,7 +75,7 @@
  * Core CS7 Configuration
  ***********************************************************************/

-enum cs7_role_t cs7_role;
+static enum cs7_role_t cs7_role;
 void *g_ctx;

 static struct cmd_node cs7_node = {
diff --git a/src/ss7_vty.h b/src/ss7_vty.h
index 18dc5a6..3bafffd 100644
--- a/src/ss7_vty.h
+++ b/src/ss7_vty.h
@@ -18,7 +18,6 @@
 };

 extern void *g_ctx;
-extern enum cs7_role_t cs7_role;
 extern const struct value_string ipproto_vals[];

 #define CS7_STR        "ITU-T Signaling System 7\n"

--
To view, visit https://gerrit.osmocom.org/c/libosmo-sigtran/+/40579?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: Ic602de42e37c4579f530823bb41e0a8193ce73bb
Gerrit-Change-Number: 40579
Gerrit-PatchSet: 2
Gerrit-Owner: pespin <pes...@sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: daniel <dwillm...@sysmocom.de>
Gerrit-Reviewer: dexter <pma...@sysmocom.de>
Gerrit-Reviewer: laforge <lafo...@osmocom.org>
Gerrit-Reviewer: osmith <osm...@sysmocom.de>
Gerrit-Reviewer: pespin <pes...@sysmocom.de>

Reply via email to