Change in osmo-ttcn3-hacks[master]: pcu: f_acknackdesc_ack_block: Fix BSN wrap-around

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

pespin gerrit-no-reply at lists.osmocom.org
Thu Nov 5 17:01:33 UTC 2020


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


Change subject: pcu: f_acknackdesc_ack_block: Fix BSN wrap-around
......................................................................

pcu: f_acknackdesc_ack_block: Fix BSN wrap-around

Change-Id: Ibe90e58e04ae5e24c36a0b3dda6742080107bd51
---
M pcu/GPRS_Components.ttcn
1 file changed, 8 insertions(+), 2 deletions(-)



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

diff --git a/pcu/GPRS_Components.ttcn b/pcu/GPRS_Components.ttcn
index 234d910..7093f31 100644
--- a/pcu/GPRS_Components.ttcn
+++ b/pcu/GPRS_Components.ttcn
@@ -625,12 +625,18 @@
 		bsn := dl_block.data_egprs.mac_hdr.bsn1;
 	}
 
-	inc := bsn - desc.starting_seq_nr + 1;
 	/* Filling hole? */
 	if (bsn < desc.starting_seq_nr) {
 		desc.receive_block_bitmap[lengthof(desc.receive_block_bitmap) - (desc.starting_seq_nr - bsn)] := int2bit(1, 1);
 		return;
 	}
+	/* Filling hole, wraparound: */
+	if (bsn - desc.starting_seq_nr > lengthof(desc.receive_block_bitmap)) {
+		desc.receive_block_bitmap[lengthof(desc.receive_block_bitmap) - (desc.starting_seq_nr + (218 - bsn))] := int2bit(1, 1);
+		return;
+	}
+
+	inc := bsn - desc.starting_seq_nr + 1;
 
 	/* SSN is increased, and so RBB values need to be moved */
 	for (i := 0; i < lengthof(desc.receive_block_bitmap) - inc; i := i+1) {
@@ -640,7 +646,7 @@
 		desc.receive_block_bitmap[i] := int2bit(0, 1);
 	}
 	/* Now we can set current bit and update SSN */
-	desc.starting_seq_nr := bsn + 1;
+	desc.starting_seq_nr := (bsn + 1) mod 128;
 	desc.receive_block_bitmap[lengthof(desc.receive_block_bitmap) - 1] := int2bit(1, 1);
 
 	/* Finally update the final_ack bit as requested: */

-- 
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/21050
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: Ibe90e58e04ae5e24c36a0b3dda6742080107bd51
Gerrit-Change-Number: 21050
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin at sysmocom.de>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20201105/5b6ec2c3/attachment.htm>


More information about the gerrit-log mailing list