Pau Espin Pedrol has uploaded this change for review. ( 
https://gerrit.osmocom.org/11335


Change subject: mgcp: osmux: Don't process regular osmux frames if disabled by 
cfg
......................................................................

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
---
M openbsc/src/libmgcp/mgcp_osmux.c
1 file changed, 12 insertions(+), 6 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/35/11335/1

diff --git a/openbsc/src/libmgcp/mgcp_osmux.c b/openbsc/src/libmgcp/mgcp_osmux.c
index 33f5721..7590f18 100644
--- a/openbsc/src/libmgcp/mgcp_osmux.c
+++ b/openbsc/src/libmgcp/mgcp_osmux.c
@@ -275,6 +275,12 @@
        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 @@
        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 @@
        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);

--
To view, visit https://gerrit.osmocom.org/11335
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: openbsc
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ief4e62fe68a11a60d90292c72d1263fd1f728356
Gerrit-Change-Number: 11335
Gerrit-PatchSet: 1
Gerrit-Owner: Pau Espin Pedrol <pes...@sysmocom.de>

Reply via email to