diff options
author | Holger Hans Peter Freyther <holger@moiji-mobile.com> | 2014-07-09 00:28:02 +0200 |
---|---|---|
committer | Holger Hans Peter Freyther <holger@moiji-mobile.com> | 2014-07-22 15:11:07 +0200 |
commit | 25a2db018eff0a86e9e79ed2aa31489535fea9c1 (patch) | |
tree | 9d0174e413fb794d216f657f98f5b3f6a7681865 | |
parent | cb6ad70994dc7686f1c89d803fcca1081b5ef32b (diff) |
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.
-rw-r--r-- | openbsc/src/libmgcp/osmux.c | 2 |
1 files changed, 1 insertions, 1 deletions
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; } |