fixeria has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmo-sccp/+/36152?usp=email )
Change subject: xua_accept_cb(): distinguish ASPs using different trans_proto
......................................................................
xua_accept_cb(): distinguish ASPs using different trans_proto
This fixes a problem found by TTCN-3 testcases: two ASPs can have
identical socket address/port, but different transport protocols.
We need to take this into account in ss7_asp_find_by_socket_addr().
Change-Id: I28aab37e8967de51ad2714543fd235d407e304c5
Related: osmo-ttcn3-hacks.git I1e2a887aa22f317783b3207494fd707d7b426439
Related: SYS#5424
---
M src/osmo_ss7_asp.c
M src/osmo_ss7_xua_srv.c
M src/ss7_internal.h
3 files changed, 20 insertions(+), 3 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/libosmo-sccp refs/changes/52/36152/1
diff --git a/src/osmo_ss7_asp.c b/src/osmo_ss7_asp.c
index f211872..5bab5ff 100644
--- a/src/osmo_ss7_asp.c
+++ b/src/osmo_ss7_asp.c
@@ -458,7 +458,7 @@
* \param[in] fd socket descriptor of given socket
* \returns SS7 ASP in case a matching one is found; NULL otherwise */
struct osmo_ss7_asp *
-ss7_asp_find_by_socket_addr(int fd)
+ss7_asp_find_by_socket_addr(int fd, int trans_proto)
{
struct osmo_ss7_instance *inst;
struct sockaddr_storage sa_l, sa_r;
@@ -505,6 +505,8 @@
llist_for_each_entry(inst, &osmo_ss7_instances, list) {
struct osmo_ss7_asp *asp;
llist_for_each_entry(asp, &inst->asp_list, list) {
+ if (asp->cfg.trans_proto != trans_proto)
+ continue;
if (asp->cfg.local.port != local_port)
continue;
if (asp->cfg.remote.port && asp->cfg.remote.port != remote_port)
diff --git a/src/osmo_ss7_xua_srv.c b/src/osmo_ss7_xua_srv.c
index 0b83b19..6da7b7a 100644
--- a/src/osmo_ss7_xua_srv.c
+++ b/src/osmo_ss7_xua_srv.c
@@ -101,7 +101,7 @@
return -1;
}
- asp = ss7_asp_find_by_socket_addr(fd);
+ asp = ss7_asp_find_by_socket_addr(fd, oxs->cfg.trans_proto);
if (asp) {
LOGP(DLSS7, LOGL_INFO, "%s: matched connection to ASP %s\n",
sock_name, asp->cfg.name);
diff --git a/src/ss7_internal.h b/src/ss7_internal.h
index ed4fae7..758da90 100644
--- a/src/ss7_internal.h
+++ b/src/ss7_internal.h
@@ -20,7 +20,7 @@
bool ss7_asp_set_default_peer_hosts(struct osmo_ss7_asp *asp);
bool ss7_asp_is_started(const struct osmo_ss7_asp *asp);
int ss7_asp_get_fd(const struct osmo_ss7_asp *asp);
-struct osmo_ss7_asp *ss7_asp_find_by_socket_addr(int fd);
+struct osmo_ss7_asp *ss7_asp_find_by_socket_addr(int fd, int trans_proto);
bool ss7_asp_protocol_check_trans_proto(enum osmo_ss7_asp_protocol proto, int trans_proto);
int ss7_default_trans_proto_for_asp_proto(enum osmo_ss7_asp_protocol proto);
--
To view, visit https://gerrit.osmocom.org/c/libosmo-sccp/+/36152?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: libosmo-sccp
Gerrit-Branch: master
Gerrit-Change-Id: I28aab37e8967de51ad2714543fd235d407e304c5
Gerrit-Change-Number: 36152
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-MessageType: newchange
Attention is currently required from: laforge.
fixeria has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-bsc/+/36146?usp=email )
Change subject: CBSP: Port over to use osmo_io via libosmo-netif
......................................................................
Patch Set 1: Code-Review+1
--
To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/36146?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: Icce412e6ee69366c7b131c9bc1d51e8d44204917
Gerrit-Change-Number: 36146
Gerrit-PatchSet: 1
Gerrit-Owner: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Attention: laforge <laforge(a)osmocom.org>
Gerrit-Comment-Date: Sat, 02 Mar 2024 20:33:31 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment