Blame SOURCES/0046-libmultipath-ignore-multipaths-sections-without-wwid.patch

60b218
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
60b218
From: Benjamin Marzinski <bmarzins@redhat.com>
60b218
Date: Mon, 16 Nov 2020 16:38:21 -0600
60b218
Subject: [PATCH] libmultipath: ignore multipaths sections without wwid option
60b218
60b218
"multipathd show config local" was crashing in find_mp_by_wwid() if
60b218
the multipath configuration included a multipaths section that did
60b218
not set a wwid option. There is no reason to keep a mpentry that
60b218
didn't set its wwid. Remove it in merge_mptable().
60b218
60b218
Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
60b218
---
60b218
 libmultipath/config.c | 7 +++++++
60b218
 1 file changed, 7 insertions(+)
60b218
60b218
diff --git a/libmultipath/config.c b/libmultipath/config.c
60b218
index a71db2d0..dc81c994 100644
60b218
--- a/libmultipath/config.c
60b218
+++ b/libmultipath/config.c
60b218
@@ -444,6 +444,13 @@ void merge_mptable(vector mptable)
60b218
 	int i, j;
60b218
 
60b218
 	vector_foreach_slot(mptable, mp1, i) {
60b218
+		/* drop invalid multipath configs */
60b218
+		if (!mp1->wwid) {
60b218
+			condlog(0, "multipaths config section missing wwid");
60b218
+			vector_del_slot(mptable, i--);
60b218
+			free_mpe(mp1);
60b218
+			continue;
60b218
+		}
60b218
 		j = i + 1;
60b218
 		vector_foreach_slot_after(mptable, mp2, j) {
60b218
 			if (strcmp(mp1->wwid, mp2->wwid))
60b218
-- 
60b218
2.17.2
60b218