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


Change subject: vty: Prohibit configuring an ASP as IPSP in an SG node
......................................................................

vty: Prohibit configuring an ASP as IPSP in an SG node

The spec explicitly prohibits it.

Change-Id: I38bbd9226bad478f8068d02f7a4d7b3711596208
---
M src/ss7_asp_vty.c
1 file changed, 9 insertions(+), 4 deletions(-)



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

diff --git a/src/ss7_asp_vty.c b/src/ss7_asp_vty.c
index b7af9c9..27b7462 100644
--- a/src/ss7_asp_vty.c
+++ b/src/ss7_asp_vty.c
@@ -414,14 +414,19 @@
 {
        struct osmo_ss7_asp *asp = vty->index;

-       if (!strcmp(argv[0], "sg"))
+       if (!strcmp(argv[0], "sg")) {
                asp->cfg.role = OSMO_SS7_ASP_ROLE_SG;
-       else if (!strcmp(argv[0], "asp"))
+       } else if (!strcmp(argv[0], "asp")) {
                asp->cfg.role = OSMO_SS7_ASP_ROLE_ASP;
-       else if (!strcmp(argv[0], "ipsp"))
+       } else if (!strcmp(argv[0], "ipsp")) {
+               if (cs7_role == CS7_ROLE_SG) {
+                       vty_out(vty, "IPSP role can't be used in an SG node 
since they are point-to-point%s", VTY_NEWLINE);
+                       return CMD_WARNING;
+               }
                asp->cfg.role = OSMO_SS7_ASP_ROLE_IPSP;
-       else
+       } else {
                OSMO_ASSERT(0);
+       }

        asp->cfg.role_set_by_vty = true;
        return CMD_SUCCESS;

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

Reply via email to