aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc
diff options
context:
space:
mode:
authorPau Espin Pedrol <pespin@sysmocom.de>2018-09-17 13:31:30 +0200
committerPau Espin Pedrol <pespin@sysmocom.de>2018-09-17 13:31:32 +0200
commit6799c38eafa4c8138a0bf6e9f0d3390ec412c5df (patch)
tree4ec37b9cebe3961e8738ff5ebf283387318a8eda /openbsc
parenta24ff4c240544126d32724e38b3da8d0c6c49666 (diff)
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
Diffstat (limited to 'openbsc')
-rw-r--r--openbsc/src/libmgcp/mgcp_osmux.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/openbsc/src/libmgcp/mgcp_osmux.c b/openbsc/src/libmgcp/mgcp_osmux.c
index ca0ed30e3..a4b7e7a87 100644
--- a/openbsc/src/libmgcp/mgcp_osmux.c
+++ b/openbsc/src/libmgcp/mgcp_osmux.c
@@ -544,8 +544,8 @@ int osmux_send_dummy(struct mgcp_endpoint *endp)
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)
{