[PATCH openbsc] mgcp_osmux: available circuit IDs from 0 to 255, not from 0 to 128
From: Pablo Neira Ayuso <pablo@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
participants (1)
-
pablo@gnumonks.org