Blame SOURCES/0002-fabrics-skip-connect-if-transport-type-doesn-t-match.patch

ce2bc8
From edf0998f5a668b141c73a9648acf427105586372 Mon Sep 17 00:00:00 2001
ce2bc8
From: Martin George <marting@netapp.com>
ce2bc8
Date: Sat, 5 Jun 2021 15:16:26 +0530
ce2bc8
Subject: [PATCH] fabrics: skip connect if transport type doesn't match
ce2bc8
ce2bc8
Discovery log page data may include records belonging to different
ce2bc8
transport types. If during a nvme connect-all, a connect is attempted
ce2bc8
on a record that doesn't match the transport type passed here, it
ce2bc8
would end up in a connect failure for that record. For e.g. one would
ce2bc8
see the below error if a connect is attempted on a tcp record but the
ce2bc8
transport type passed here is 'fc' and its associated parameters:
ce2bc8
ce2bc8
nvme_tcp: malformed src address passed: nn-0xXXXX:pn-0xYYYY
ce2bc8
ce2bc8
Fix this by proceeding with the connect only if the appropriate
ce2bc8
transport type matches a given record during the connect-all.
ce2bc8
ce2bc8
Signed-off-by: Martin George <marting@netapp.com>
ce2bc8
---
ce2bc8
 fabrics.c | 4 ++++
ce2bc8
 1 file changed, 4 insertions(+)
ce2bc8
ce2bc8
diff --git a/fabrics.c b/fabrics.c
ce2bc8
index db42ddb..6cc142d 100644
ce2bc8
--- a/fabrics.c
ce2bc8
+++ b/fabrics.c
ce2bc8
@@ -1354,6 +1354,10 @@ static bool should_connect(struct nvmf_disc_rsp_page_entry *entry)
ce2bc8
 	if (cargs_match_found(entry))
ce2bc8
 		return false;
ce2bc8
 
ce2bc8
+	/* skip connect if the transport type doesn't match */
ce2bc8
+	if (strcmp(fabrics_cfg.transport, trtype_str(entry->trtype)))
ce2bc8
+		return false;
ce2bc8
+
ce2bc8
 	if (!fabrics_cfg.matching_only || !fabrics_cfg.traddr)
ce2bc8
 		return true;
ce2bc8
 
ce2bc8
-- 
ce2bc8
2.27.0
ce2bc8