pespin has submitted this change. (
https://gerrit.osmocom.org/c/osmo-hnbgw/+/38669?usp=email )
Change subject: hnbgw: Fix wrong map object retrieved from hashtable
......................................................................
hnbgw: Fix wrong map object retrieved from hashtable
If several map objects (mapping between RUA and SCCP transports for a
given Iu connection) ended up in the same hashtable bucket, then the
first one was always returned by map_from_conn_id().
As a result, when such collisions happened (e.g. when a big number of
connections were inserted) a user could see a Iu message coming from SCCP
connection "A" end up being forwarded to an unrelated RUA connection
"B".
Related: SYS#6602
Fixes: f3caea850bc892551cd09bbaf49f798c172590c4
Change-Id: I107f461bf5bcb92262422c893b23d190659f6f72
---
M src/osmo-hnbgw/hnbgw_cn.c
1 file changed, 4 insertions(+), 2 deletions(-)
Approvals:
lynxis lazus: Looks good to me, approved
Jenkins Builder: Verified
fixeria: Looks good to me, but someone else must approve
diff --git a/src/osmo-hnbgw/hnbgw_cn.c b/src/osmo-hnbgw/hnbgw_cn.c
index b984a8e..a74b6d7 100644
--- a/src/osmo-hnbgw/hnbgw_cn.c
+++ b/src/osmo-hnbgw/hnbgw_cn.c
@@ -447,8 +447,10 @@
const struct osmo_prim_hdr *oph)
{
struct hnbgw_context_map *map;
- hash_for_each_possible(hsu->hnbgw_context_map_by_conn_id, map, hnbgw_sccp_user_entry,
conn_id)
- return map;
+ hash_for_each_possible(hsu->hnbgw_context_map_by_conn_id, map, hnbgw_sccp_user_entry,
conn_id) {
+ if (map->scu_conn_id == conn_id)
+ return map;
+ }
LOGP(DRANAP, LOGL_ERROR, "Rx for unknown SCCP connection ID: %u: %s\n",
conn_id, osmo_scu_prim_hdr_name_c(OTC_SELECT, oph));
return NULL;
--
To view, visit
https://gerrit.osmocom.org/c/osmo-hnbgw/+/38669?usp=email
To unsubscribe, or for help writing mail filters, visit
https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: merged
Gerrit-Project: osmo-hnbgw
Gerrit-Branch: master
Gerrit-Change-Id: I107f461bf5bcb92262422c893b23d190659f6f72
Gerrit-Change-Number: 38669
Gerrit-PatchSet: 2
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: lynxis lazus <lynxis(a)fe80.eu>
Gerrit-Reviewer: osmith <osmith(a)sysmocom.de>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>