laforge has submitted this change. ( https://gerrit.osmocom.org/c/osmo-mgw/+/28272 )
Change subject: iuup: Check for IuUP Initialization retrans ......................................................................
iuup: Check for IuUP Initialization retrans
Since libosmocore.git Change-Id I5cb740702805693cc7f0a550e2e093f9bfdd507c, the IuUP stack can send INIT event more than once, it sends one each time an IuUP Initialization message is received. This is done since potentially a peer could send an Initialization message at any time with a different subflow size configuration. So ideally we should update all osmo-mgw state regarding codecs, and forward the Init starting the procedure on the other conn of the endpoint. However, this scenario is most probably not going to happen right now and it would be a lot of work to implement and test, and subsequent INITs we received will almost surely come from retransmissions of the initial Initialization message, which means content will not really change. Hence, it makes sense to simply drop the receive message (the IuUP stack already takes care of re-ACKing it) and let the endpoint state continue with its ongoing procedures.
Related: SYS#4705 Change-Id: Ib97bc6f57d265622e24a776b96f0a82c25d33d39 --- M src/libosmo-mgcp/mgcp_iuup.c 1 file changed, 11 insertions(+), 2 deletions(-)
Approvals: Jenkins Builder: Verified laforge: Looks good to me, approved
diff --git a/src/libosmo-mgcp/mgcp_iuup.c b/src/libosmo-mgcp/mgcp_iuup.c index 120b330..142b002 100644 --- a/src/libosmo-mgcp/mgcp_iuup.c +++ b/src/libosmo-mgcp/mgcp_iuup.c @@ -365,13 +365,22 @@ int rc = 0; struct msgb *msg;
- /* Find RFCI containing NO_DATA: */ - conn_rtp_src->iuup.rfci_id_no_data = _find_rfci_no_data(irp); + if (conn_rtp_src->iuup.init_ind) { + /* We received more than one IuUP Initialization. It's probably + * a retransmission, so simply ignore it (lower layers take care + * of ACKing it). */ + LOGPCONN(conn_rtp_src->conn, DRTP, LOGL_INFO, + "Ignoring potential IuUP Initialization retrans\n"); + return 0; + }
msg = msgb_copy_c(conn_rtp_src->conn, irp->oph.msg, "iuup-init-copy"); conn_rtp_src->iuup.init_ind = (struct osmo_iuup_rnl_prim *)msgb_data(msg); conn_rtp_src->iuup.init_ind->oph.msg = msg;
+ /* Find RFCI containing NO_DATA: */ + conn_rtp_src->iuup.rfci_id_no_data = _find_rfci_no_data(irp); + conn_dst = _find_dst_conn(conn_rtp_src->conn); /* If not yet there, peer will potentially be IuUP-Initialized later * when we attempt to bridge audio towards it. See bridge_iuup_to_iuup_peer() */