Change in libosmo-sccp[master]: xua: ipa_asp_fsm: Allow receiving IPA ID ACK before IPA ID RESP

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

laforge gerrit-no-reply at lists.osmocom.org
Tue Nov 12 14:18:40 UTC 2019


laforge has submitted this change. ( https://gerrit.osmocom.org/c/libosmo-sccp/+/16005 )

Change subject: xua: ipa_asp_fsm: Allow receiving IPA ID ACK before IPA ID RESP
......................................................................

xua: ipa_asp_fsm: Allow receiving IPA ID ACK before IPA ID RESP

Since there's no official spec for IPA and some
implementations seem to like sending the IPA ID ACK before
the IPA ID RESP, let's catch it and feed it after we receive
the IPA ID RESP and we are in correct state. Otherwise the connection
would deadlock during the initial handshake.

That's the case with our TTCN3 IPA implementation running STP_Tests
suite.

Change-Id: I99f5346a3854ca07979020245897334197f3cd3b
---
M src/xua_asp_fsm.c
1 file changed, 16 insertions(+), 1 deletion(-)

Approvals:
  laforge: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/src/xua_asp_fsm.c b/src/xua_asp_fsm.c
index 0a84f28..e09c46c 100644
--- a/src/xua_asp_fsm.c
+++ b/src/xua_asp_fsm.c
@@ -768,6 +768,8 @@
 	struct ipaccess_unit *ipa_unit;
 	/* Timer for tracking if no PONG is received in response to PING */
 	struct osmo_timer_list pong_timer;
+	/* Did we receive IPA ID ACK before IPA ID RESP ? */
+	bool ipa_id_ack_rcvd;
 };
 
 enum ipa_asp_fsm_t {
@@ -857,8 +859,20 @@
 		if (fd >= 0) {
 			ipaccess_send_id_ack(fd);
 			osmo_fsm_inst_state_chg(fi, IPA_ASP_S_WAIT_ID_ACK2, 10, T_WAIT_ID_ACK);
+			/* If we received the ACK beforehand, submit it now */
+			if (iafp->ipa_id_ack_rcvd) {
+				iafp->ipa_id_ack_rcvd = false;
+				osmo_fsm_inst_dispatch(fi, IPA_ASP_E_ID_ACK, NULL);
+			}
 		}
 		break;
+	case IPA_ASP_E_ID_ACK:
+		/* Since there's no official spec for IPA and some
+		   implementations seem to like sending the IPA ID ACK before
+		   the IPA ID RESP, let's catch it and feed it after we receive
+		   the IPA ID RESP and we are in correct state */
+		iafp->ipa_id_ack_rcvd = true;
+		break;
 	}
 	return;
 out_err:
@@ -1058,7 +1072,8 @@
 	},
 	/* Server Side */
 	[IPA_ASP_S_WAIT_ID_RESP] = {
-		.in_event_mask = S(IPA_ASP_E_ID_RESP),
+		.in_event_mask = S(IPA_ASP_E_ID_RESP) |
+				 S(IPA_ASP_E_ID_ACK),
 		.out_state_mask = S(IPA_ASP_S_WAIT_ID_ACK2) |
 				  S(IPA_ASP_S_DOWN),
 		.name = "WAIT_ID_RESP",

-- 
To view, visit https://gerrit.osmocom.org/c/libosmo-sccp/+/16005
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: libosmo-sccp
Gerrit-Branch: master
Gerrit-Change-Id: I99f5346a3854ca07979020245897334197f3cd3b
Gerrit-Change-Number: 16005
Gerrit-PatchSet: 2
Gerrit-Owner: pespin <pespin at sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge at osmocom.org>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20191112/7cdadeeb/attachment.htm>


More information about the gerrit-log mailing list