Attention is currently required from: laforge, neels.
pespin has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-hnbgw/+/36889?usp=email )
Change subject: add hnb_persistent hashtable: optimize lookup by cell id
......................................................................
Patch Set 4:
(1 comment)
File src/osmo-hnbgw/hnbgw.c:
https://gerrit.osmocom.org/c/osmo-hnbgw/+/36889/comment/b1e2d324_fa1e0da3
PS4, Line 245: /* source: http://www.cse.yorku.ca/~oz/hash.html */
> I would by default always use the jenkins hash functions, see jhash.[ch] of the Linux kernel.
That's one of the reasons I end up using rb trees. I don't need to care about hash functions :D
--
To view, visit https://gerrit.osmocom.org/c/osmo-hnbgw/+/36889?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-hnbgw
Gerrit-Branch: master
Gerrit-Change-Id: Iecb81eba28263ecf90a09c108995f6fb6f5f81f2
Gerrit-Change-Number: 36889
Gerrit-PatchSet: 4
Gerrit-Owner: neels <nhofmeyr(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: neels <nhofmeyr(a)sysmocom.de>
Gerrit-Attention: laforge <laforge(a)osmocom.org>
Gerrit-Comment-Date: Wed, 22 May 2024 15:00:44 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: neels <nhofmeyr(a)sysmocom.de>
Comment-In-Reply-To: laforge <laforge(a)osmocom.org>
Gerrit-MessageType: comment
laforge has submitted this change. ( https://gerrit.osmocom.org/c/libosmo-sccp/+/36884?usp=email )
Change subject: ipa: Use pseudo-random number for SLS in IPA->M3UA direction
......................................................................
ipa: Use pseudo-random number for SLS in IPA->M3UA direction
[back-port of Ia4e66d660b6057338f66a47fffc8a0d32759f733]
In Change-Id Ice7bab997b84cfed00c7d6d780c70f4e9fac6002 we introduced
code that would make the LSB of the file descriptor be used as SLS
when passing packets from IPA in M3UA direction.
This did however not achieve sufficient entropy in real-world use cases.
In this change, we change over to allocating a pseudo-random SLS to each
IPA connection at the time it is established; We then assign that SLS
to each packet received on that IPA connection.
Change-Id: I97f43bd3bdd89a6bf21a84284a060305fcbb86e7
Related: SYS#6543
Closes: SYS#6802
---
M src/osmo_ss7_asp.c
M stp/stp_main.c
2 files changed, 34 insertions(+), 1 deletion(-)
Approvals:
laforge: Looks good to me, approved
Jenkins Builder: Verified
pespin: Looks good to me, but someone else must approve
diff --git a/src/osmo_ss7_asp.c b/src/osmo_ss7_asp.c
index e1c197c..b017510 100644
--- a/src/osmo_ss7_asp.c
+++ b/src/osmo_ss7_asp.c
@@ -906,7 +906,9 @@
}
msg->dst = asp;
rate_ctr_inc2(asp->ctrg, SS7_ASP_CTR_PKT_RX_TOTAL);
- return ipa_rx_msg(asp, msg, ofd->fd & 0xf);
+ /* we simply use the lower 4 bits of the asp_id, which is initialized to a pseudo-random value upon
+ * connect */
+ return ipa_rx_msg(asp, msg, asp->asp_id & 0xf);
}
/* netif code tells us we can read something from the socket */
@@ -996,6 +998,12 @@
if (asp->cfg.proto != OSMO_SS7_ASP_PROT_IPA) {
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 feld as SLS; let's initialize it here from a
+ * pseudo-random value */
+ asp->asp_id = rand() & 0xf;
+ }
}
if (asp->lm && asp->lm->prim_cb) {
diff --git a/stp/stp_main.c b/stp/stp_main.c
index 01d1865..d630032 100644
--- a/stp/stp_main.c
+++ b/stp/stp_main.c
@@ -213,6 +213,8 @@
{
int rc;
+ srand(time(NULL));
+
tall_stp_ctx = talloc_named_const(NULL, 1, "osmo-stp");
msgb_talloc_ctx_init(tall_stp_ctx, 0);
osmo_init_logging2(tall_stp_ctx, &log_info);
--
To view, visit https://gerrit.osmocom.org/c/libosmo-sccp/+/36884?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: libosmo-sccp
Gerrit-Branch: for-1.8
Gerrit-Change-Id: I97f43bd3bdd89a6bf21a84284a060305fcbb86e7
Gerrit-Change-Number: 36884
Gerrit-PatchSet: 1
Gerrit-Owner: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-MessageType: merged
laforge has submitted this change. ( https://gerrit.osmocom.org/c/libosmo-sccp/+/36885?usp=email )
Change subject: Bump version: 1.8.1-dirty → 1.8.2
......................................................................
Bump version: 1.8.1-dirty → 1.8.2
Let's tag a 1.8.2 just containing the change of more random
SLS allocation in IPA / SCCPlite links.
Change-Id: I63c39cfd7af0b8deb7f7c9ff0ec519f2bc05117c
---
M debian/changelog
M src/Makefile.am
2 files changed, 19 insertions(+), 1 deletion(-)
Approvals:
laforge: Looks good to me, approved
Jenkins Builder: Verified
pespin: Looks good to me, but someone else must approve
diff --git a/debian/changelog b/debian/changelog
index cd1c181..b3bf213 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,9 @@
+libosmo-sccp (1.8.2) unstable; urgency=medium
+
+ * ipa: Use pseudo-random number for SLS in IPA->M3UA direction
+
+ -- Harald Welte <laforge(a)osmocom.org> Tue, 21 May 2024 14:28:44 +0200
+
libosmo-sccp (1.8.1) unstable; urgency=medium
* Fix counting received IPA packets in server mode
diff --git a/src/Makefile.am b/src/Makefile.am
index c87848d..5fba62a 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -25,7 +25,7 @@
# This is _NOT_ the library release version, it's an API version.
# Please read Chapter 6 "Library interface versions" of the libtool
# documentation before making any modification
-LIBVERSION=9:1:0
+LIBVERSION=9:2:0
libosmo_sigtran_la_SOURCES = sccp_sap.c sua.c m3ua.c xua_msg.c sccp_helpers.c \
sccp2sua.c sccp_scrc.c sccp_sclc.c sccp_scoc.c \
--
To view, visit https://gerrit.osmocom.org/c/libosmo-sccp/+/36885?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: libosmo-sccp
Gerrit-Branch: for-1.8
Gerrit-Change-Id: I63c39cfd7af0b8deb7f7c9ff0ec519f2bc05117c
Gerrit-Change-Number: 36885
Gerrit-PatchSet: 1
Gerrit-Owner: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-MessageType: merged
laforge has posted comments on this change. ( https://gerrit.osmocom.org/c/libosmo-sccp/+/36884?usp=email )
Change subject: ipa: Use pseudo-random number for SLS in IPA->M3UA direction
......................................................................
Patch Set 1: Code-Review+2
--
To view, visit https://gerrit.osmocom.org/c/libosmo-sccp/+/36884?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: libosmo-sccp
Gerrit-Branch: for-1.8
Gerrit-Change-Id: I97f43bd3bdd89a6bf21a84284a060305fcbb86e7
Gerrit-Change-Number: 36884
Gerrit-PatchSet: 1
Gerrit-Owner: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-Comment-Date: Wed, 22 May 2024 14:56:29 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment
Attention is currently required from: neels, pespin.
laforge has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-hnbgw/+/36889?usp=email )
Change subject: add hnb_persistent hashtable: optimize lookup by cell id
......................................................................
Patch Set 4:
(1 comment)
File src/osmo-hnbgw/hnbgw.c:
https://gerrit.osmocom.org/c/osmo-hnbgw/+/36889/comment/a9d5cf95_9a0c957e
PS4, Line 245: /* source: http://www.cse.yorku.ca/~oz/hash.html */
> I am not very sure about whether this here is the right way. […]
I would by default always use the jenkins hash functions, see jhash.[ch] of the Linux kernel.
--
To view, visit https://gerrit.osmocom.org/c/osmo-hnbgw/+/36889?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-hnbgw
Gerrit-Branch: master
Gerrit-Change-Id: Iecb81eba28263ecf90a09c108995f6fb6f5f81f2
Gerrit-Change-Number: 36889
Gerrit-PatchSet: 4
Gerrit-Owner: neels <nhofmeyr(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: neels <nhofmeyr(a)sysmocom.de>
Gerrit-Attention: pespin <pespin(a)sysmocom.de>
Gerrit-Comment-Date: Wed, 22 May 2024 14:50:41 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: neels <nhofmeyr(a)sysmocom.de>
Gerrit-MessageType: comment
Attention is currently required from: laforge, pespin.
neels has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-hnbgw/+/36889?usp=email )
Change subject: add hnb_persistent hashtable: optimize lookup by cell id
......................................................................
Patch Set 4:
(2 comments)
File include/osmocom/hnbgw/hnbgw.h:
https://gerrit.osmocom.org/c/osmo-hnbgw/+/36889/comment/1a6c8607_3dafe643
PS3, Line 463: DECLARE_HASHTABLE(hnb_persistent_by_id, 5);
> is this 5 related to the one in mkhash_add()? if so, it may make sense to use a define, or some hash […]
no, this is just how many bits to use for the hash table.
That mkhash stuff is to get to something that this here can handle (up to 64 bit input)
File src/osmo-hnbgw/hnbgw.c:
https://gerrit.osmocom.org/c/osmo-hnbgw/+/36889/comment/135863b6_01741fea
PS4, Line 245: /* source: http://www.cse.yorku.ca/~oz/hash.html */
I am not very sure about whether this here is the right way. Maybe we need a generic arbitrary-buffer-to-hash function, or maybe there already is one that I don't know about?
Or maybe we can just feed the last 64 bit of the umts_cell_id to the hashtable's hash function?
--
To view, visit https://gerrit.osmocom.org/c/osmo-hnbgw/+/36889?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-hnbgw
Gerrit-Branch: master
Gerrit-Change-Id: Iecb81eba28263ecf90a09c108995f6fb6f5f81f2
Gerrit-Change-Number: 36889
Gerrit-PatchSet: 4
Gerrit-Owner: neels <nhofmeyr(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: laforge <laforge(a)osmocom.org>
Gerrit-Attention: pespin <pespin(a)sysmocom.de>
Gerrit-Comment-Date: Wed, 22 May 2024 14:40:18 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: pespin <pespin(a)sysmocom.de>
Gerrit-MessageType: comment
Attention is currently required from: neels.
pespin has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-hnbgw/+/36889?usp=email )
Change subject: add hnb_persistent hashtable: optimize lookup by cell id
......................................................................
Patch Set 3:
(1 comment)
File include/osmocom/hnbgw/hnbgw.h:
https://gerrit.osmocom.org/c/osmo-hnbgw/+/36889/comment/d3798ded_d8ef4011
PS3, Line 463: DECLARE_HASHTABLE(hnb_persistent_by_id, 5);
is this 5 related to the one in mkhash_add()? if so, it may make sense to use a define, or some hashtable object field if it exists instead in there.
--
To view, visit https://gerrit.osmocom.org/c/osmo-hnbgw/+/36889?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-hnbgw
Gerrit-Branch: master
Gerrit-Change-Id: Iecb81eba28263ecf90a09c108995f6fb6f5f81f2
Gerrit-Change-Number: 36889
Gerrit-PatchSet: 3
Gerrit-Owner: neels <nhofmeyr(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-CC: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: neels <nhofmeyr(a)sysmocom.de>
Gerrit-Comment-Date: Wed, 22 May 2024 14:35:38 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Gerrit-MessageType: comment