Attention is currently required from: pespin.
fixeria has posted comments on this change. ( https://gerrit.osmocom.org/c/libosmo-sccp/+/30284 )
Change subject: sccp: Validate local references > 0x00fffffe are not used
......................................................................
Patch Set 1: Code-Review+1
--
To view, visit https://gerrit.osmocom.org/c/libosmo-sccp/+/30284
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: libosmo-sccp
Gerrit-Branch: master
Gerrit-Change-Id: Ia547346bdae54a032d2198ecd4972fb3f8dd073e
Gerrit-Change-Number: 30284
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Attention: pespin <pespin(a)sysmocom.de>
Gerrit-Comment-Date: Wed, 23 Nov 2022 18:27:26 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment
pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-hnbgw/+/30283 )
Change subject: hnbgw: Avoid allocating SCCP conn id >0x00fffffe
......................................................................
hnbgw: Avoid allocating SCCP conn id >0x00fffffe
This breaks use of M3UA/SCCP after 2**24 connection IDs have been
allocated.
Related: SYS#6211
Change-Id: I03bad960f65fbff6e467def5bba60fefb328f962
---
M src/osmo-hnbgw/context_map.c
1 file changed, 14 insertions(+), 1 deletion(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-hnbgw refs/changes/83/30283/1
diff --git a/src/osmo-hnbgw/context_map.c b/src/osmo-hnbgw/context_map.c
index c069651..81f2d11 100644
--- a/src/osmo-hnbgw/context_map.c
+++ b/src/osmo-hnbgw/context_map.c
@@ -58,8 +58,21 @@
uint32_t i;
uint32_t id;
- for (i = 0; i < 0xffffffff; i++) {
+ /* SUA: RFC3868 sec 3.10.4:
+ * The source reference number is a 4 octet long integer.
+ * This isallocated by the source SUA instance.
+ * M3UA/SCCP: ITU-T Q.713 sec 3.3:
+ * The "source local reference" parameter field is a three-octet field containing a reference number
+ * which is generated and used by the local node to identify the connection section after the connection
+ * section is set up.
+ * The coding "all ones" is reserved for future use.
+ * Hence, let's simply use 24 bit ids to fit all link types (excluding 0x00ffffff).
+ */
+
+ for (i = 0; i < 0x00ffffff; i++) {
id = cn->next_conn_id++;
+ if (cn->next_conn_id == 0x00ffffff)
+ cn->next_conn_id = 0;
if (!cn_id_in_use(cn, id)) {
*id_out = id;
return 1;
--
To view, visit https://gerrit.osmocom.org/c/osmo-hnbgw/+/30283
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-hnbgw
Gerrit-Branch: master
Gerrit-Change-Id: I03bad960f65fbff6e467def5bba60fefb328f962
Gerrit-Change-Number: 30283
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-MessageType: newchange