From 25a2db018eff0a86e9e79ed2aa31489535fea9c1 Mon Sep 17 00:00:00 2001 From: Holger Hans Peter Freyther Date: Wed, 9 Jul 2014 00:28:02 +0200 Subject: osmux: Using the "CI" and calling it "CID" is plain wrong The CI is a MGCP value that is counted from 0 upwards. The code is comparing a uint8_t with a uint32_t. This will only work for up to UINT8_MAX calls and then will silently break. The code should probably work with the endpoint number and not the CI. For now truncate things and hope things work. --- openbsc/src/libmgcp/osmux.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'openbsc/src') diff --git a/openbsc/src/libmgcp/osmux.c b/openbsc/src/libmgcp/osmux.c index 71d001f02..1c59e261b 100644 --- a/openbsc/src/libmgcp/osmux.c +++ b/openbsc/src/libmgcp/osmux.c @@ -171,7 +171,7 @@ endpoint_lookup(struct mgcp_config *cfg, int cid, return NULL; } - if (tmp->ci == cid && this->s_addr == from_addr->s_addr) + if ((tmp->ci & 0xFF) == cid && this->s_addr == from_addr->s_addr) return tmp; } -- cgit v1.2.3