mgcp_osmux: available circuit IDs from 0 to 255, not from 0 to 128

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

[hfreyther: Update the testcase now that we have more ids to allocate]
This commit is contained in:
Pablo Neira Ayuso 2015-10-15 07:57:29 +02:00 committed by Holger Hans Peter Freyther
parent 568a727550
commit 11cb27ece6
2 changed files with 2 additions and 2 deletions

View File

@ -543,7 +543,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_used_cid(void)
{

View File

@ -1186,7 +1186,7 @@ static void test_osmux_cid(void)
osmux_put_cid(id);
OSMO_ASSERT(osmux_used_cid() == 0);
for (i = 0; i < 128; ++i) {
for (i = 0; i < 256; ++i) {
id = osmux_get_cid();
OSMO_ASSERT(id == i);
OSMO_ASSERT(osmux_used_cid() == i + 1);