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

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