[PATCH openbsc] mgcp_osmux: available circuit IDs from 0 to 255, not from 0 to 128

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/OpenBSC@lists.osmocom.org/.

pablo at gnumonks.org pablo at gnumonks.org
Thu Oct 15 05:57:29 UTC 2015


From: Pablo Neira Ayuso <pablo at soleta.eu>

Holger reports that the bitmap that accounts for available Osmux circuit
IDs is limited to 128, when the maximum number of circuit IDs are
determined by the uint8_t field in the header (ie. 256 circuits).
---
@Holger: Will be revisiting libosmo-netif too, at quick glance I can see
         insufficient validation of several functions there that take this
	 allocated ccid as input parameter.

 openbsc/src/libmgcp/mgcp_osmux.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/openbsc/src/libmgcp/mgcp_osmux.c b/openbsc/src/libmgcp/mgcp_osmux.c
index 90b7368..d110f42 100644
--- a/openbsc/src/libmgcp/mgcp_osmux.c
+++ b/openbsc/src/libmgcp/mgcp_osmux.c
@@ -530,7 +530,7 @@ int osmux_send_dummy(struct mgcp_endpoint *endp)
 }
 
 /* bsc-nat allocates/releases the Osmux circuit ID */
-static uint8_t osmux_cid_bitmap[16];
+static uint8_t osmux_cid_bitmap[(OSMUX_CID_MAX + 1) / 8];
 
 int osmux_get_cid(void)
 {
-- 
2.1.4




More information about the OpenBSC mailing list