blob: 396b6d32e3450b2f6a2c1d3081090f8524dd8c1e [file] [log] [blame]
Brad Bishopd7bf8c12018-02-25 22:55:05 -05001From f88d60a93e98d86ae294f2317a122c4efde276f0 Mon Sep 17 00:00:00 2001
2From: Benjamin Marzinski <bmarzins@redhat.com>
3Date: Wed, 31 May 2017 17:58:59 -0500
4Subject: [PATCH 10/14] mpath: skip device configs without vendor/product
5
6Right now if multipath.conf includes a device configuration without a
7vendor or product string, it will automatically be applied to all
8devices, skipping all other configs entirely. This is clearly wrong.
9This patch makes sure that user added configs include vendor and
10product strings
11
12Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
13---
14 libmultipath/config.c | 7 +++++++
15 1 file changed, 7 insertions(+)
16
17diff --git a/libmultipath/config.c b/libmultipath/config.c
18index c485748..bdde113 100644
19--- a/libmultipath/config.c
20+++ b/libmultipath/config.c
21@@ -452,6 +452,13 @@ restart:
22 break;
23 j = n;
24 vector_foreach_slot_after(hw, hwe2, j) {
25+ /* drop invalid device configs */
26+ if (!hwe2->vendor || !hwe2->product) {
27+ condlog(0, "device config missing vendor or product parameter");
28+ vector_del_slot(hw, j--);
29+ free_hwe(hwe2);
30+ continue;
31+ }
32 if (hwe_regmatch(hwe1, hwe2))
33 continue;
34 /* dup */
35--
362.8.1
37