osmux: allow enabling osmux only on correct activating state

State ACTIVATING is set once negotiation between the 2 parts went
successfuly.

Port from openbsc 96bd7b075a59eb051079152241b127ca944b0781.
Change-Id: Ic56eda1251be41369d869e687a1cf955df2c6d61
This commit is contained in:
Pau Espin Pedrol
2018-10-16 16:03:57 +02:00
parent 852ba86949
commit 48aff62341

View File

@@ -536,9 +536,9 @@ int osmux_enable_conn(struct mgcp_endpoint *endp, struct mgcp_conn_rtp *conn,
uint16_t osmux_dummy = endp->cfg->osmux_dummy;
/* Check if osmux is enabled for the specified connection */
if (conn->osmux.state == OSMUX_STATE_DISABLED) {
LOGP(DLMGCP, LOGL_ERROR, "OSMUX not enabled for conn:%s\n",
mgcp_conn_dump(conn->conn));
if (conn->osmux.state != OSMUX_STATE_ACTIVATING) {
LOGP(DLMGCP, LOGL_ERROR, "conn:%s didn't negotiate Osmux, state %d\n",
mgcp_conn_dump(conn->conn), conn->osmux.state);
return -1;
}