Harald Welte has submitted this change and it was merged. ( 
https://gerrit.osmocom.org/11509 )

Change subject: skip simple-client default as/asp when saving VTY config
......................................................................

skip simple-client default as/asp when saving VTY config

When saving the current VTY config to a configuration file,
do not write out AS/ASP configuration items which are generated
as a fallback by osmo_sccp_simple_client_on_ss7_id().

Since the user did not explicitly configure these configuration
items they should not be saved to the user's configuration file.

Change-Id: Id8a3afc6dee29ae1ee9c862cbe404a61fe979dba
Related: OS#3616
---
M include/osmocom/sigtran/osmo_ss7.h
M src/osmo_ss7_vty.c
M src/sccp_user.c
3 files changed, 11 insertions(+), 4 deletions(-)

Approvals:
  Jenkins Builder: Verified
  Harald Welte: Looks good to me, approved



diff --git a/include/osmocom/sigtran/osmo_ss7.h 
b/include/osmocom/sigtran/osmo_ss7.h
index 34d5408..414606a 100644
--- a/include/osmocom/sigtran/osmo_ss7.h
+++ b/include/osmocom/sigtran/osmo_ss7.h
@@ -298,6 +298,9 @@
        /*! Were we dynamically allocated by RKM? */
        bool rkm_dyn_allocated;

+       /*! Were we allocated by "simple client" support? */
+       bool simple_client_allocated;
+
        struct {
                char *name;
                char *description;
@@ -380,6 +383,9 @@
        /*! Were we dynamically allocated */
        bool dyn_allocated;
 
+       /*! Were we allocated by "simple client" support? */
+       bool simple_client_allocated;
+
        /*! Pending message for non-blocking IPA read */
        struct msgb *pending_msg;

diff --git a/src/osmo_ss7_vty.c b/src/osmo_ss7_vty.c
index 7ef58cf..1b7bcb9 100644
--- a/src/osmo_ss7_vty.c
+++ b/src/osmo_ss7_vty.c
@@ -679,9 +679,8 @@

 static void write_one_asp(struct vty *vty, struct osmo_ss7_asp *asp)
 {
-       /* skip any dynamically created ASPs (auto-created at connect
-        * time) */
-       if (asp->dyn_allocated)
+       /* skip any dynamically created ASPs (e.g. auto-created at connect 
time) */
+       if (asp->dyn_allocated || asp->simple_client_allocated)
                return;

        vty_out(vty, " asp %s %u %u %s%s",
@@ -939,7 +938,7 @@
        unsigned int i;

        /* skip any dynamically allocated AS definitions */
-       if (as->rkm_dyn_allocated)
+       if (as->rkm_dyn_allocated || as->simple_client_allocated)
                return;

        vty_out(vty, " as %s %s%s", as->cfg.name,
diff --git a/src/sccp_user.c b/src/sccp_user.c
index 793e08c..8a98e46 100644
--- a/src/sccp_user.c
+++ b/src/sccp_user.c
@@ -409,6 +409,7 @@
                        goto out_ss7;
                as_created = true;
                as->cfg.routing_key.pc = ss7->cfg.primary_pc;
+               as->simple_client_allocated = true;
        }
        LOGP(DLSCCP, LOGL_NOTICE, "%s: Using AS instance %s\n", name,
             as->cfg.name);
@@ -457,6 +458,7 @@
                                asp->cfg.remote.host =
                                    talloc_strdup(asp, default_remote_ip);
                        }
+                       asp->simple_client_allocated = true;
                } else
                        talloc_free(asp_name);


--
To view, visit https://gerrit.osmocom.org/11509
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: libosmo-sccp
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: Id8a3afc6dee29ae1ee9c862cbe404a61fe979dba
Gerrit-Change-Number: 11509
Gerrit-PatchSet: 1
Gerrit-Owner: Stefan Sperling <ssperl...@sysmocom.de>
Gerrit-Reviewer: Harald Welte <lafo...@gnumonks.org>
Gerrit-Reviewer: Jenkins Builder (1000002)

Reply via email to