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


Change subject: fix SCCP_MAX_OPTIONAL_DATA 128
......................................................................

fix SCCP_MAX_OPTIONAL_DATA 128

Related: SYS#7600
Change-Id: I841dbb2e8cbc13708ba7f5593f6bdd3b8da4329c
---
M include/osmocom/sccp/sccp_types.h
1 file changed, 19 insertions(+), 1 deletion(-)



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

diff --git a/include/osmocom/sccp/sccp_types.h 
b/include/osmocom/sccp/sccp_types.h
index 5be0392..ab688b3 100644
--- a/include/osmocom/sccp/sccp_types.h
+++ b/include/osmocom/sccp/sccp_types.h
@@ -24,7 +24,25 @@
 #include <osmocom/core/endian.h>
 #include <osmocom/core/utils.h>

-#define SCCP_MAX_OPTIONAL_DATA 130
+/* ITU Q.713 3.16 Data is a variable-length IE, meaning it has two header
+ * octets:
+ * - one octet of "Parameter name code",
+ * - plus one octet of length.
+ *
+ * In
+ * - 4.2 CR,
+ * - 4.3 CC,
+ * - 4.4 CREF,
+ * - 4.5 RLSD,
+ * there are optional "Data" IEs with length indicated as "3-130" octets: the
+ * minimum of 3 stems from the two header octets plus one data octet. Note that
+ * when there are zero data octets, the entire "Data" IE is omitted.
+ *
+ * Hence, the maximum of 130 includes the two header octets, and the actual
+ * maximum data length is 128.
+ */
+#define SCCP_MAX_OPTIONAL_DATA 128
+
 #define SCCP_MAX_DATA 256

 /* Table 1/Q.713 - SCCP message types */

--
To view, visit https://gerrit.osmocom.org/c/libosmo-sigtran/+/41192?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: I841dbb2e8cbc13708ba7f5593f6bdd3b8da4329c
Gerrit-Change-Number: 41192
Gerrit-PatchSet: 1
Gerrit-Owner: neels <[email protected]>

Reply via email to