osmith has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/osmo-bsc/+/38760?usp=email )


Change subject: Use new libosmo-sigtran API osmo_ss7_as_select_asp()
......................................................................

Use new libosmo-sigtran API osmo_ss7_as_select_asp()

Depends: libosmo-sigtran.git Change-Id b9f6b542bbae925e23ca7c4de27cdff59021ccb9
Change-Id: I0f2e3d6cbdf443c0194b61df7479aecf4073e19c
(cherry picked from commit 9faff7766f0f091ac84463c3670e4d38ee0ff38e)
---
M src/osmo-bsc/bsc_ctrl.c
1 file changed, 8 insertions(+), 18 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/60/38760/1

diff --git a/src/osmo-bsc/bsc_ctrl.c b/src/osmo-bsc/bsc_ctrl.c
index 06553da..de7060b 100644
--- a/src/osmo-bsc/bsc_ctrl.c
+++ b/src/osmo-bsc/bsc_ctrl.c
@@ -644,26 +644,10 @@
        return as;
 }

-static int _ss7_as_send(struct osmo_ss7_as *as, struct msgb *msg)
-{
-       struct osmo_ss7_asp *asp;
-       unsigned int i;
-
-       /* FIXME: unify with xua_as_transmit_msg() and perform proper ASP 
lookup */
-       for (i = 0; i < ARRAY_SIZE(as->cfg.asps); i++) {
-               asp = as->cfg.asps[i];
-               if (!asp)
-                       continue;
-               /* FIXME: deal with multiple ASPs per AS */
-               return osmo_ss7_asp_send(asp, msg);
-       }
-       msgb_free(msg);
-       return -1;
-}
-
 int bsc_sccplite_msc_send(struct bsc_msc_data *msc, struct msgb *msg)
 {
        struct osmo_ss7_as *as;
+       struct osmo_ss7_asp *asp;

        as = msc_get_ss7_as(msc);
        if (!as) {
@@ -677,7 +661,13 @@
                return 0;
        }

-       return _ss7_as_send(as, msg);
+       asp = osmo_ss7_as_select_asp(as);
+       if (!asp) {
+               LOGP(DCTRL, LOGL_NOTICE, "No ASP found for AS, dropping 
message\n");
+               msgb_free(msg);
+               return -1;
+       }
+       return osmo_ss7_asp_send(asp, msg);
 }

 /* Encode a CTRL command and send it to the given ASP

--
To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/38760?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings?usp=email

Gerrit-MessageType: newchange
Gerrit-Project: osmo-bsc
Gerrit-Branch: osmith/1.12.2
Gerrit-Change-Id: I0f2e3d6cbdf443c0194b61df7479aecf4073e19c
Gerrit-Change-Number: 38760
Gerrit-PatchSet: 1
Gerrit-Owner: osmith <[email protected]>
Gerrit-CC: pespin <[email protected]>

Reply via email to