diff options
author | Pau Espin Pedrol <pespin@sysmocom.de> | 2018-10-12 19:44:42 +0200 |
---|---|---|
committer | Pau Espin Pedrol <pespin@sysmocom.de> | 2018-10-12 19:44:50 +0200 |
commit | a42d4584fd01c9cd1021fab609bdaaafe859c13a (patch) | |
tree | a5e3dcbdf4e99d8ccbb4919be57e84c8d0372f70 | |
parent | 37a0307b6193c9b108cfd1aa2a88517a8b5cb907 (diff) |
mgcp: osmux: Don't process regular osmux frames if disabled by cfg
Prior to this commit, the check was only done on legacy dummy frames.
Change-Id: Ief4e62fe68a11a60d90292c72d1263fd1f728356
-rw-r--r-- | openbsc/src/libmgcp/mgcp_osmux.c | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/openbsc/src/libmgcp/mgcp_osmux.c b/openbsc/src/libmgcp/mgcp_osmux.c index 33f5721b7..7590f1812 100644 --- a/openbsc/src/libmgcp/mgcp_osmux.c +++ b/openbsc/src/libmgcp/mgcp_osmux.c @@ -275,6 +275,12 @@ int osmux_read_from_bsc_nat_cb(struct osmo_fd *ofd, unsigned int what) if (!msg) return -1; + if (!cfg->osmux) { + LOGP(DMGCP, LOGL_ERROR, + "bsc-nat wants to use Osmux but bsc did not request it\n"); + goto out; + } + /* not any further processing dummy messages */ if (msg->data[0] == MGCP_DUMMY_LOAD) goto out; @@ -319,12 +325,6 @@ static int osmux_handle_dummy(struct mgcp_config *cfg, struct sockaddr_in *addr, LOGP(DMGCP, LOGL_DEBUG, "Received Osmux dummy load from %s\n", inet_ntoa(addr->sin_addr)); - if (!cfg->osmux) { - LOGP(DMGCP, LOGL_ERROR, - "bsc wants to use Osmux but bsc-nat did not request it\n"); - goto out; - } - /* extract the osmux CID from the dummy message */ memcpy(&osmux_cid, &msg->data[1], sizeof(osmux_cid)); @@ -365,6 +365,12 @@ int osmux_read_from_bsc_cb(struct osmo_fd *ofd, unsigned int what) if (!msg) return -1; + if (!cfg->osmux) { + LOGP(DMGCP, LOGL_ERROR, + "bsc wants to use Osmux but bsc-nat did not request it\n"); + goto out; + } + /* not any further processing dummy messages */ if (msg->data[0] == MGCP_DUMMY_LOAD) return osmux_handle_dummy(cfg, &addr, msg); |