Harald Welte has submitted this change and it was merged. ( 
https://gerrit.osmocom.org/11374 )

Change subject: osmux: Avoid initing output without enabling osmux
......................................................................

osmux: Avoid initing output without enabling osmux

Otherwise we end up in a weird state where we have timers set up but
osmux is still flagged as not enabled.

Cherry-picked from openbsc cad739d2386640a68c24e3d470ddacdcaf377561.
Change-Id: I0a334842463d311bc80a980e60fb702a0a9ad610
---
M src/libosmo-mgcp/mgcp_osmux.c
1 file changed, 5 insertions(+), 5 deletions(-)

Approvals:
  Jenkins Builder: Verified
  Harald Welte: Looks good to me, approved



diff --git a/src/libosmo-mgcp/mgcp_osmux.c b/src/libosmo-mgcp/mgcp_osmux.c
index f842232..9ae82cd 100644
--- a/src/libosmo-mgcp/mgcp_osmux.c
+++ b/src/libosmo-mgcp/mgcp_osmux.c
@@ -284,7 +284,7 @@
        };

        rate_ctr_inc(&conn_net->rate_ctr_group->ctr[RTP_PACKETS_TX_CTR]);
-       rate_ctr_add(&conn_net->rate_ctr_group->ctr[RTP_OCTETS_TX_CTR], 
msg->len);
+       rate_ctr_add(&conn_net->rate_ctr_group->ctr[RTP_OCTETS_TX_CTR], 
msg->len);

        /* Send RTP data to BTS */
        /* FIXME: Get rid of conn_bts and conn_net! */
@@ -530,10 +530,6 @@
                return -1;
        }

-       osmux_xfrm_output_init(&conn->osmux.out,
-                              (conn->osmux.cid * rtp_ssrc_winlen) +
-                              (random() % rtp_ssrc_winlen));
-
        conn->osmux.in = osmux_handle_lookup(endp->cfg, addr, port);
        if (!conn->osmux.in) {
                LOGP(DLMGCP, LOGL_ERROR, "Cannot allocate input osmux handle 
for conn:%s\n",
@@ -546,6 +542,10 @@
                return -1;
        }

+       osmux_xfrm_output_init(&conn->osmux.out,
+                              (conn->osmux.cid * rtp_ssrc_winlen) +
+                              (random() % rtp_ssrc_winlen));
+
        switch (endp->cfg->role) {
                case MGCP_BSC_NAT:
                        conn->type = MGCP_OSMUX_BSC_NAT;

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

Gerrit-Project: osmo-mgw
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I0a334842463d311bc80a980e60fb702a0a9ad610
Gerrit-Change-Number: 11374
Gerrit-PatchSet: 1
Gerrit-Owner: Pau Espin Pedrol <pes...@sysmocom.de>
Gerrit-Reviewer: Harald Welte <lafo...@gnumonks.org>
Gerrit-Reviewer: Jenkins Builder (1000002)

Reply via email to