Change in openbsc[master]: mgcp: Fix (again) osmux_cid_bitmap static array size calculation

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

Pau Espin Pedrol gerrit-no-reply at lists.osmocom.org
Mon Sep 17 11:33:35 UTC 2018


Pau Espin Pedrol has uploaded this change for review. ( https://gerrit.osmocom.org/10997


Change subject: mgcp: Fix (again) osmux_cid_bitmap static array size calculation
......................................................................

mgcp: Fix (again) osmux_cid_bitmap static array size calculation

A previous commit merged today fixed array size boundary (multiple of 8
bits), but removed a required +1 which should be kept on top, because
OSMUX_CID_MAX specified the maximum number used by a CID, that is
(0,OSMUX_CID_MAX), and as a result we require OSMUX_CID_MAX+1 slots.

Fixes: 65f422ad5878165be0a1eb05605aa3099536f0c8
Change-Id: I182c9c1a6dd28a4c5c0d8107d53852cf47541592
---
M openbsc/src/libmgcp/mgcp_osmux.c
1 file changed, 2 insertions(+), 2 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/97/10997/1

diff --git a/openbsc/src/libmgcp/mgcp_osmux.c b/openbsc/src/libmgcp/mgcp_osmux.c
index ca0ed30..a4b7e7a 100644
--- a/openbsc/src/libmgcp/mgcp_osmux.c
+++ b/openbsc/src/libmgcp/mgcp_osmux.c
@@ -544,8 +544,8 @@
 			     htons(endp->cfg->osmux_port), buf, sizeof(buf));
 }
 
-/* bsc-nat allocates/releases the Osmux circuit ID */
-static uint8_t osmux_cid_bitmap[(OSMUX_CID_MAX + 7) / 8];
+/* bsc-nat allocates/releases the Osmux circuit ID. +7 to round up to 8 bit boundary. */
+static uint8_t osmux_cid_bitmap[(OSMUX_CID_MAX + 1 + 7) / 8];
 
 int osmux_used_cid(void)
 {

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

Gerrit-Project: openbsc
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I182c9c1a6dd28a4c5c0d8107d53852cf47541592
Gerrit-Change-Number: 10997
Gerrit-PatchSet: 1
Gerrit-Owner: Pau Espin Pedrol <pespin at sysmocom.de>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20180917/b6a3d831/attachment.htm>


More information about the gerrit-log mailing list