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


Change subject: ipa: Fix asp_id/SLS unset in tcp-server mode
......................................................................

ipa: Fix asp_id/SLS unset in tcp-server mode

Commit changing the value set to asp_id (used to derive SLS) for IPA
conns only updated the asp_id value on the stream_cli code path, but not
on the stream_srv one.
As a result, on IPA conns with an underlaying TCP server conn, asp_id
and SLS was always 0.

Fixes: 2c9ba16 "ipa: Use pseudo-random number for SLS in IPA->M3UA direction
(cherry picked from commit a3232c4b7ba8d90f852211c987a4a438c8970aa6)
Change-Id: I4e8e8d58e9425fc6fce5e4e15a79e86ff4518270
---
M src/osmo_ss7_asp.c
M src/osmo_ss7_xua_srv.c
2 files changed, 10 insertions(+), 4 deletions(-)



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

diff --git a/src/osmo_ss7_asp.c b/src/osmo_ss7_asp.c
index d81d25c..57ebc82 100644
--- a/src/osmo_ss7_asp.c
+++ b/src/osmo_ss7_asp.c
@@ -945,8 +945,8 @@
                rc = ss7_asp_apply_primary_address(asp);
        } else {
                if (asp->cfg.proto == OSMO_SS7_ASP_PROT_IPA) {
-                       /* we use the lower 4 bits of the asp_id feld as SLS; 
let's initialize it here from a
-                        * pseudo-random value */
+                       /* we use the lower 4 bits of the asp_id field as SLS;
+                        * let's initialize it here from a pseudo-random value 
*/
                        asp->asp_id = rand() & 0xf;
                }
        }
diff --git a/src/osmo_ss7_xua_srv.c b/src/osmo_ss7_xua_srv.c
index 4962bfd..35e360f 100644
--- a/src/osmo_ss7_xua_srv.c
+++ b/src/osmo_ss7_xua_srv.c
@@ -61,7 +61,7 @@
  * SS7 xUA Server
  ***********************************************************************/

-/* server has accept()ed a new SCTP association, let's find the ASP for
+/* Server has accept()ed a new SCTP association / TCP connection, let's find 
the ASP for
  * it (if any) */
 static int xua_accept_cb(struct osmo_stream_srv_link *link, int fd)
 {
@@ -177,9 +177,15 @@
         * data */
        osmo_stream_srv_set_data(srv, asp);

-       if (oxs->cfg.trans_proto == IPPROTO_SCTP) {
+       if (asp->cfg.trans_proto == IPPROTO_SCTP) {
                rc = ss7_asp_apply_peer_primary_address(asp);
                rc = ss7_asp_apply_primary_address(asp);
+       } else {
+               if (asp->cfg.proto == OSMO_SS7_ASP_PROT_IPA) {
+                       /* we use the lower 4 bits of the asp_id field as SLS;
+                        * let's initialize it here from a pseudo-random value 
*/
+                       asp->asp_id = rand() & 0xf;
+               }
        }

        /* send M-SCTP_ESTABLISH.ind to Layer Manager */

--
To view, visit https://gerrit.osmocom.org/c/libosmo-sigtran/+/40388?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: I4e8e8d58e9425fc6fce5e4e15a79e86ff4518270
Gerrit-Change-Number: 40388
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pes...@sysmocom.de>

Reply via email to