<p>laforge <strong>submitted</strong> this change.</p><p><a href="https://gerrit.osmocom.org/c/libosmo-sccp/+/16005">View Change</a></p><div style="white-space:pre-wrap">Approvals:
laforge: Looks good to me, approved
Jenkins Builder: Verified
</div><pre style="font-family: monospace,monospace; white-space: pre-wrap;">xua: ipa_asp_fsm: Allow receiving IPA ID ACK before IPA ID RESP<br><br>Since there's no official spec for IPA and some<br>implementations seem to like sending the IPA ID ACK before<br>the IPA ID RESP, let's catch it and feed it after we receive<br>the IPA ID RESP and we are in correct state. Otherwise the connection<br>would deadlock during the initial handshake.<br><br>That's the case with our TTCN3 IPA implementation running STP_Tests<br>suite.<br><br>Change-Id: I99f5346a3854ca07979020245897334197f3cd3b<br>---<br>M src/xua_asp_fsm.c<br>1 file changed, 16 insertions(+), 1 deletion(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/src/xua_asp_fsm.c b/src/xua_asp_fsm.c</span><br><span>index 0a84f28..e09c46c 100644</span><br><span>--- a/src/xua_asp_fsm.c</span><br><span>+++ b/src/xua_asp_fsm.c</span><br><span>@@ -768,6 +768,8 @@</span><br><span> struct ipaccess_unit *ipa_unit;</span><br><span> /* Timer for tracking if no PONG is received in response to PING */</span><br><span> struct osmo_timer_list pong_timer;</span><br><span style="color: hsl(120, 100%, 40%);">+ /* Did we receive IPA ID ACK before IPA ID RESP ? */</span><br><span style="color: hsl(120, 100%, 40%);">+ bool ipa_id_ack_rcvd;</span><br><span> };</span><br><span> </span><br><span> enum ipa_asp_fsm_t {</span><br><span>@@ -857,8 +859,20 @@</span><br><span> if (fd >= 0) {</span><br><span> ipaccess_send_id_ack(fd);</span><br><span> osmo_fsm_inst_state_chg(fi, IPA_ASP_S_WAIT_ID_ACK2, 10, T_WAIT_ID_ACK);</span><br><span style="color: hsl(120, 100%, 40%);">+ /* If we received the ACK beforehand, submit it now */</span><br><span style="color: hsl(120, 100%, 40%);">+ if (iafp->ipa_id_ack_rcvd) {</span><br><span style="color: hsl(120, 100%, 40%);">+ iafp->ipa_id_ack_rcvd = false;</span><br><span style="color: hsl(120, 100%, 40%);">+ osmo_fsm_inst_dispatch(fi, IPA_ASP_E_ID_ACK, NULL);</span><br><span style="color: hsl(120, 100%, 40%);">+ }</span><br><span> }</span><br><span> break;</span><br><span style="color: hsl(120, 100%, 40%);">+ case IPA_ASP_E_ID_ACK:</span><br><span style="color: hsl(120, 100%, 40%);">+ /* Since there's no official spec for IPA and some</span><br><span style="color: hsl(120, 100%, 40%);">+ implementations seem to like sending the IPA ID ACK before</span><br><span style="color: hsl(120, 100%, 40%);">+ the IPA ID RESP, let's catch it and feed it after we receive</span><br><span style="color: hsl(120, 100%, 40%);">+ the IPA ID RESP and we are in correct state */</span><br><span style="color: hsl(120, 100%, 40%);">+ iafp->ipa_id_ack_rcvd = true;</span><br><span style="color: hsl(120, 100%, 40%);">+ break;</span><br><span> }</span><br><span> return;</span><br><span> out_err:</span><br><span>@@ -1058,7 +1072,8 @@</span><br><span> },</span><br><span> /* Server Side */</span><br><span> [IPA_ASP_S_WAIT_ID_RESP] = {</span><br><span style="color: hsl(0, 100%, 40%);">- .in_event_mask = S(IPA_ASP_E_ID_RESP),</span><br><span style="color: hsl(120, 100%, 40%);">+ .in_event_mask = S(IPA_ASP_E_ID_RESP) |</span><br><span style="color: hsl(120, 100%, 40%);">+ S(IPA_ASP_E_ID_ACK),</span><br><span> .out_state_mask = S(IPA_ASP_S_WAIT_ID_ACK2) |</span><br><span> S(IPA_ASP_S_DOWN),</span><br><span> .name = "WAIT_ID_RESP",</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.osmocom.org/c/libosmo-sccp/+/16005">change 16005</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://gerrit.osmocom.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.osmocom.org/c/libosmo-sccp/+/16005"/><meta itemprop="name" content="View Change"/></div></div>
<div style="display:none"> Gerrit-Project: libosmo-sccp </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-Change-Id: I99f5346a3854ca07979020245897334197f3cd3b </div>
<div style="display:none"> Gerrit-Change-Number: 16005 </div>
<div style="display:none"> Gerrit-PatchSet: 2 </div>
<div style="display:none"> Gerrit-Owner: pespin <pespin@sysmocom.de> </div>
<div style="display:none"> Gerrit-Reviewer: Jenkins Builder </div>
<div style="display:none"> Gerrit-Reviewer: laforge <laforge@osmocom.org> </div>
<div style="display:none"> Gerrit-MessageType: merged </div>