laforge submitted this change.

View Change

Approvals: osmith: Looks good to me, but someone else must approve Jenkins Builder: Verified laforge: Looks good to me, approved
vty: Make sure user doesn't configure AS in ASP role with a non-local PC as routing-key

AS in ASP mode doesn't expect to route incomign traffic to other nodes.
They are expected to announce its routing-key (local PC) to the SG so it
knows how to reach it and in turn announce (un)availability to other
SG/ASPs in the network.

Change-Id: Ibbf990fd8dcbdc67ebc4118597b34a5767320cf6
---
M src/ss7_as_vty.c
M src/ss7_vty.c
M src/ss7_vty.h
3 files changed, 14 insertions(+), 1 deletion(-)

diff --git a/src/ss7_as_vty.c b/src/ss7_as_vty.c
index 0b0ddc1..e94e0c2 100644
--- a/src/ss7_as_vty.c
+++ b/src/ss7_as_vty.c
@@ -581,6 +581,18 @@
struct osmo_ss7_as *as = vty->index;
vty->node = L_CS7_NODE;
vty->index = as->inst;
+
+ /* Config sanity checks: */
+
+ /* AS in ASP role should be configured with a local PC which they can
+ * then announce using RKM.
+ * Still, allow STPs to have AS(P) configured in an ASP mode to talk to a
+ * peer STP by announcing remove PCs. */
+ if (cs7_role == CS7_ROLE_ASP &&
+ ss7_as_get_local_role(as) == OSMO_SS7_ASP_ROLE_ASP &&
+ !osmo_ss7_pc_is_local(as->inst, as->cfg.routing_key.pc))
+ vty_out(vty, "%% AS with local role ASP should have a local PC configured in its routing-key. Fix your config!%s", VTY_NEWLINE);
+
return 0;
}

diff --git a/src/ss7_vty.c b/src/ss7_vty.c
index d774236..b333c7f 100644
--- a/src/ss7_vty.c
+++ b/src/ss7_vty.c
@@ -76,7 +76,7 @@
* Core CS7 Configuration
***********************************************************************/

-static enum cs7_role_t cs7_role;
+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 3bafffd..18dc5a6 100644
--- a/src/ss7_vty.h
+++ b/src/ss7_vty.h
@@ -18,6 +18,7 @@
};

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 change 40586. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-MessageType: merged
Gerrit-Project: libosmo-sigtran
Gerrit-Branch: master
Gerrit-Change-Id: Ibbf990fd8dcbdc67ebc4118597b34a5767320cf6
Gerrit-Change-Number: 40586
Gerrit-PatchSet: 2
Gerrit-Owner: pespin <pespin@sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: daniel <dwillmann@sysmocom.de>
Gerrit-Reviewer: laforge <laforge@osmocom.org>
Gerrit-Reviewer: osmith <osmith@sysmocom.de>