osmux: Move setting OSMUX_STATE_DISABLED to initializer function

Change-Id: I7c184b17075fc3e71f1f66775e16b56a5ae91b62
This commit is contained in:
Pau Espin Pedrol
2022-10-06 16:21:37 +02:00
parent 9735d21b9d
commit c0e1b1aec5
3 changed files with 5 additions and 3 deletions

View File

@@ -95,6 +95,9 @@ static int mgcp_rtp_conn_init(struct mgcp_conn_rtp *conn_rtp, struct mgcp_conn *
static atomic_uint rate_ctr_index = 0;
conn_rtp->type = MGCP_RTP_DEFAULT;
/* Osmux specific defaults, only used if conn is later on Osmux-enabled: */
conn_rtp->osmux.state = OSMUX_STATE_DISABLED;
conn_rtp->osmux.local_cid_allocated = false;
conn_rtp->osmux.local_cid = 0;
conn_rtp->osmux.remote_cid_present = false;

View File

@@ -524,6 +524,8 @@ int osmux_init_conn(struct mgcp_conn_rtp *conn)
conn->osmux.ctrg = rate_ctr_group_alloc(conn->conn, &rate_ctr_group_osmux_desc, conn->ctrg->idx);
conn->type = MGCP_RTP_OSMUX;
/* Annotate Osmux circuit ID and set it to negotiating state until this
* is fully set up from the dummy load. */
conn->osmux.state = OSMUX_STATE_ACTIVATING;
return 0;
}

View File

@@ -1003,9 +1003,6 @@ mgcp_header_done:
goto error2;
}
/* Annotate Osmux circuit ID and set it to negotiating state until this
* is fully set up from the dummy load. */
conn->osmux.state = OSMUX_STATE_DISABLED;
/* If X-Osmux (remote CID) was received (-1 is wilcard), alloc next avail CID as local CID */
if (remote_osmux_cid >= -1) {
if (osmux_init_conn(conn) < 0) {