pespin submitted this change.

View Change

Approvals: pespin: Looks good to me, approved neels: Looks good to me, approved Jenkins Builder: Verified
mgw: MDCX: Simplify early return code paths

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

diff --git a/src/libosmo-mgcp/mgcp_protocol.c b/src/libosmo-mgcp/mgcp_protocol.c
index 7095058..34b0111 100644
--- a/src/libosmo-mgcp/mgcp_protocol.c
+++ b/src/libosmo-mgcp/mgcp_protocol.c
@@ -1192,26 +1192,23 @@
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 change 39250. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-MessageType: merged
Gerrit-Project: osmo-mgw
Gerrit-Branch: master
Gerrit-Change-Id: Icb03a95e34e0c7d9396fefc2e37ee33ab09daa89
Gerrit-Change-Number: 39250
Gerrit-PatchSet: 7
Gerrit-Owner: pespin <pespin@sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: daniel <dwillmann@sysmocom.de>
Gerrit-Reviewer: laforge <laforge@osmocom.org>
Gerrit-Reviewer: neels <nhofmeyr@sysmocom.de>
Gerrit-Reviewer: pespin <pespin@sysmocom.de>