pespin has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/osmo-mgw/+/39250?usp=email )


Change subject: mgw: MDCX: Simplify early return code paths
......................................................................

mgw: MDCX: Simplify early return code paths

Change-Id: Icb03a95e34e0c7d9396fefc2e37ee33ab09daa89
---
M src/libosmo-mgcp/mgcp_protocol.c
1 file changed, 15 insertions(+), 17 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/50/39250/1

diff --git a/src/libosmo-mgcp/mgcp_protocol.c b/src/libosmo-mgcp/mgcp_protocol.c
index 46c6815..9166854 100644
--- a/src/libosmo-mgcp/mgcp_protocol.c
+++ b/src/libosmo-mgcp/mgcp_protocol.c
@@ -1189,26 +1189,24 @@
        if (mgcp_conn_rtp_is_osmux(conn_rtp)) {
                OSMO_ASSERT(conn_rtp->osmux.local_cid_allocated);
                if (hpars->remote_osmux_cid < -1) {
-                       LOGPCONN(conn, DLMGCP, LOGL_ERROR,
-                                "MDCX: Failed to parse Osmux CID!\n");
+                       LOGPCONN(conn, DLMGCP, LOGL_ERROR, "MDCX: Failed to 
parse Osmux CID!\n");
                        goto error3;
-               } else if (hpars->remote_osmux_cid == -1) {
-                       LOGPCONN(conn, DLMGCP, LOGL_ERROR,
-                                "MDCX: wilcard in MDCX is not supported!\n");
+               }
+               if (hpars->remote_osmux_cid == -1) {
+                       LOGPCONN(conn, DLMGCP, LOGL_ERROR, "MDCX: wilcard in 
MDCX is not supported!\n");
                        goto error3;
-               } else if (conn_rtp->osmux.remote_cid_present &&
-                          hpars->remote_osmux_cid != 
conn_rtp->osmux.remote_cid) {
-                       LOGPCONN(conn, DLMGCP, LOGL_ERROR,
-                               "MDCX: changing already allocated CID is not 
supported!\n");
+               }
+               if (conn_rtp->osmux.remote_cid_present &&
+                   hpars->remote_osmux_cid != conn_rtp->osmux.remote_cid) {
+                       LOGPCONN(conn, DLMGCP, LOGL_ERROR, "MDCX: changing 
already allocated CID is not supported!\n");
                        goto error3;
-               } else {
-                       conn_rtp->osmux.remote_cid_present = true;
-                       conn_rtp->osmux.remote_cid = hpars->remote_osmux_cid;
-                       if (conn_osmux_event_rx_crcx_mdcx(conn_rtp) < 0) {
-                               LOGPCONN(conn, DLMGCP, LOGL_ERROR,
-                                       "MDCX: Osmux handling failed!\n");
-                               goto error3;
-                       }
+               }
+               conn_rtp->osmux.remote_cid_present = true;
+               conn_rtp->osmux.remote_cid = hpars->remote_osmux_cid;
+               if (conn_osmux_event_rx_crcx_mdcx(conn_rtp) < 0) {
+                       LOGPCONN(conn, DLMGCP, LOGL_ERROR,
+                               "MDCX: Osmux handling failed!\n");
+                       goto error3;
                }
        }


--
To view, visit https://gerrit.osmocom.org/c/osmo-mgw/+/39250?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings?usp=email

Gerrit-MessageType: newchange
Gerrit-Project: osmo-mgw
Gerrit-Branch: master
Gerrit-Change-Id: Icb03a95e34e0c7d9396fefc2e37ee33ab09daa89
Gerrit-Change-Number: 39250
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <[email protected]>

Reply via email to