Change in libosmocore[master]: CBSP: Fix encoding of warning period

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/.

laforge gerrit-no-reply at lists.osmocom.org
Mon Feb 22 09:06:23 UTC 2021


laforge has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmocore/+/23018 )


Change subject: CBSP: Fix encoding of warning period
......................................................................

CBSP: Fix encoding of warning period

The warning period encoding was wrong, resulting in way too short
warning periods being encoded than intended/specified by the caller.

Change-Id: Idf3cae48a6ab45550d7bbd937bb49a0e1a4e8aed
---
M src/gsm/cbsp.c
1 file changed, 4 insertions(+), 4 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/18/23018/1

diff --git a/src/gsm/cbsp.c b/src/gsm/cbsp.c
index fa599c5..353f53f 100644
--- a/src/gsm/cbsp.c
+++ b/src/gsm/cbsp.c
@@ -130,13 +130,13 @@
 	if (secs <= 10)
 		return secs;
 	if (secs <= 30)
-		return (secs-10)/2;
+		return 10 + (secs-10)/2;
 	if (secs <= 120)
-		return (secs-30)/5;
+		return 30 + (secs-30)/5;
 	if (secs <= 600)
-		return (secs-120)/10;
+		return 120 + (secs-120)/10;
 	if (secs <= 60*60)
-		return (secs-600)/30;
+		return 600 + (secs-600)/30;
 	osmo_cbsp_errstr = "warning period out of range";
 	return -1;
 }

-- 
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/23018
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: Idf3cae48a6ab45550d7bbd937bb49a0e1a4e8aed
Gerrit-Change-Number: 23018
Gerrit-PatchSet: 1
Gerrit-Owner: laforge <laforge at osmocom.org>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20210222/6f70b4a6/attachment.htm>


More information about the gerrit-log mailing list