Change in libosmo-sccp[master]: m3ua/sua: Add quirk for allowing inbound DAUD from SG in ASP role.

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
Thu May 13 19:59:03 UTC 2021


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

Change subject: m3ua/sua: Add quirk for allowing inbound DAUD from SG in ASP role.
......................................................................

m3ua/sua: Add quirk for allowing inbound DAUD from SG in ASP role.

The M3UA RFC talks about this message being used in ASP->SG direction,
not the other way around.

Closes: OS#5147
Change-Id: I36ff172b47142a877b37bbd149073bef35b36a74
---
M include/osmocom/sigtran/osmo_ss7.h
M src/m3ua.c
M src/osmo_ss7_vty.c
M src/sua.c
4 files changed, 29 insertions(+), 9 deletions(-)

Approvals:
  Jenkins Builder: Verified
  fixeria: Looks good to me, but someone else must approve
  osmith: Looks good to me, but someone else must approve
  pespin: Looks good to me, approved



diff --git a/include/osmocom/sigtran/osmo_ss7.h b/include/osmocom/sigtran/osmo_ss7.h
index 8370dd9..a799b04 100644
--- a/include/osmocom/sigtran/osmo_ss7.h
+++ b/include/osmocom/sigtran/osmo_ss7.h
@@ -433,6 +433,8 @@
 
 /*! Peer SG doesn't send NTFY(AS-INACTIVE) after ASP-UP procedure */
 #define OSMO_SS7_ASP_QUIRK_NO_NOTIFY	0x00000001
+/*! Accept DAUD in ASP role (RFC states only permitted in ASP->SG role) */
+#define OSMO_SS7_ASP_QUIRK_DAUD_IN_ASP	0x00000002
 
 int osmo_ss7_asp_peer_snprintf(char* buf, size_t buf_len, struct osmo_ss7_asp_peer *peer);
 int osmo_ss7_asp_peer_set_hosts(struct osmo_ss7_asp_peer *peer, void *talloc_ctx,
diff --git a/src/m3ua.c b/src/m3ua.c
index 77326e0..9fe17ad 100644
--- a/src/m3ua.c
+++ b/src/m3ua.c
@@ -901,6 +901,18 @@
 			xua->hdr.msg_type);
 		/* silently ignore those to not confuse the sender */
 		break;
+	case M3UA_SNM_DAUD:
+		/* RFC states only permitted in ASP->SG direction, not reverse. But some
+		 * equipment still sends it to us as ASP ?!? */
+		if (asp->cfg.quirks & OSMO_SS7_ASP_QUIRK_DAUD_IN_ASP) {
+			LOGPASP(asp, DLM3UA, LOGL_NOTICE, "quirk daud_in_asp active: Accepting DAUD "
+				"despite being in ASP role\n");
+			xua_snm_rx_daud(asp, xua);
+		} else {
+			LOGPASP(asp, DLM3UA, LOGL_ERROR, "DAUD not permitted in ASP role\n");
+			return M3UA_ERR_UNSUPP_MSG_TYPE;
+		}
+		break;
 	default:
 		return M3UA_ERR_UNSUPP_MSG_TYPE;
 	}
diff --git a/src/osmo_ss7_vty.c b/src/osmo_ss7_vty.c
index bc84bca..b2e3192 100644
--- a/src/osmo_ss7_vty.c
+++ b/src/osmo_ss7_vty.c
@@ -56,12 +56,14 @@
 	"IPA Multiplex (SCCP Lite)\n"
 
 static const struct value_string asp_quirk_names[] = {
-	{ OSMO_SS7_ASP_QUIRK_NO_NOTIFY, "no_notify" },
+	{ OSMO_SS7_ASP_QUIRK_NO_NOTIFY,		"no_notify" },
+	{ OSMO_SS7_ASP_QUIRK_DAUD_IN_ASP,	"daud_in_asp" },
 	{ 0, NULL }
 };
 
 static const struct value_string asp_quirk_descs[] = {
 	{ OSMO_SS7_ASP_QUIRK_NO_NOTIFY, "Peer SG doesn't send NTFY(AS-INACTIVE) after ASP-UP" },
+	{ OSMO_SS7_ASP_QUIRK_DAUD_IN_ASP, "Allow Rx of DAUD in ASP role" },
 	{ 0, NULL }
 };
 
@@ -762,11 +764,7 @@
 	CMD_ATTR_IMMEDIATE)
 {
 	struct osmo_ss7_asp *asp = vty->index;
-#if 0	/* we only have one quirk, so there is no argv[0] yet! */
 	int quirk = get_string_value(asp_quirk_names, argv[0]);
-#else
-	int quirk = get_string_value(asp_quirk_names, "no_notify");
-#endif
 
 	if (quirk < 0)
 		return CMD_WARNING;
@@ -781,11 +779,7 @@
 	CMD_ATTR_IMMEDIATE)
 {
 	struct osmo_ss7_asp *asp = vty->index;
-#if 0	/* we only have one quirk, so there is no argv[0] yet! */
 	int quirk = get_string_value(asp_quirk_names, argv[0]);
-#else
-	int quirk = get_string_value(asp_quirk_names, "no_notify");
-#endif
 
 	if (quirk < 0)
 		return CMD_WARNING;
diff --git a/src/sua.c b/src/sua.c
index 2ff5a9a..997b511 100644
--- a/src/sua.c
+++ b/src/sua.c
@@ -912,6 +912,18 @@
 			xua->hdr.msg_type);
 		/* silently ignore those to not confuse the sender */
 		break;
+	case SUA_SNM_DAUD:
+		/* RFC states only permitted in ASP->SG direction, not reverse. But some
+		 * equipment still sends it to us as ASP ?!? */
+		if (asp->cfg.quirks & OSMO_SS7_ASP_QUIRK_DAUD_IN_ASP) {
+			LOGPASP(asp, DLSUA, LOGL_NOTICE, "quirk daud_in_asp active: Accepting DAUD "
+				"despite being in ASP role\n");
+			xua_snm_rx_daud(asp, xua);
+		} else {
+			LOGPASP(asp, DLSUA, LOGL_ERROR, "DAUD not permitted in ASP role\n");
+			return SUA_ERR_UNSUPP_MSG_TYPE;
+		}
+		break;
 	default:
 		return SUA_ERR_UNSUPP_MSG_TYPE;
 	}

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

Gerrit-Project: libosmo-sccp
Gerrit-Branch: master
Gerrit-Change-Id: I36ff172b47142a877b37bbd149073bef35b36a74
Gerrit-Change-Number: 24214
Gerrit-PatchSet: 4
Gerrit-Owner: laforge <laforge at osmocom.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy at sysmocom.de>
Gerrit-Reviewer: laforge <laforge at osmocom.org>
Gerrit-Reviewer: osmith <osmith at sysmocom.de>
Gerrit-Reviewer: pespin <pespin at sysmocom.de>
Gerrit-CC: dexter <pmaier at sysmocom.de>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20210513/1875643a/attachment.htm>


More information about the gerrit-log mailing list