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

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