pespin has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/28167 )


Change subject: ggsn: Fix seq_nr overflow
......................................................................

ggsn: Fix seq_nr overflow

As seen running a test:
GTP_Templates.ttcn:87 Dynamic test case error: The first argument of function 
int2oct(), which is 65536, does not fit in 2 octets.

Change-Id: Icbaf42879bade6f5b4e39144ec123bc1b3f893f8
---
M ggsn_tests/GGSN_Tests.ttcn
1 file changed, 2 insertions(+), 2 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks 
refs/changes/67/28167/1

diff --git a/ggsn_tests/GGSN_Tests.ttcn b/ggsn_tests/GGSN_Tests.ttcn
index ae2a9bf..3993ad6 100644
--- a/ggsn_tests/GGSN_Tests.ttcn
+++ b/ggsn_tests/GGSN_Tests.ttcn
@@ -369,14 +369,14 @@
        /* send GTP-C for a given context and increment sequence number */
        function f_send_gtpc(in template Gtp1cUnitdata data) runs on GT_CT {
                GTPC.send(data);
-               g_c_seq_nr := g_c_seq_nr + 1;
+               g_c_seq_nr := (g_c_seq_nr + 1) mod 65536;
        }

        /* send GTP-U for a given context and increment sequence number */
        function f_send_gtpu(inout PdpContext ctx, in octetstring data) runs on 
GT_CT {
                if (use_gtpu_txseq) {
                        GTPU.send(ts_GTP1U_GPDU(g_peer_u, g_d_seq_nr, 
ctx.teid_remote, data));
-                       g_d_seq_nr := g_d_seq_nr + 1;
+                       g_d_seq_nr := (g_d_seq_nr + 1) mod 65536;
                } else {
                        GTPU.send(ts_GTP1U_GPDU(g_peer_u, omit, 
ctx.teid_remote, data));
                }

--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/28167
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: Icbaf42879bade6f5b4e39144ec123bc1b3f893f8
Gerrit-Change-Number: 28167
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <[email protected]>
Gerrit-MessageType: newchange

Reply via email to