Blame SOURCES/0021-bond-crash-mode-rh1459580.patch

fc9aca
From 27b3757b5beecc9fcd98ce3a1acbc50431c204cb Mon Sep 17 00:00:00 2001
fc9aca
From: Beniamino Galvani <bgalvani@redhat.com>
fc9aca
Date: Wed, 7 Jun 2017 18:51:41 +0200
fc9aca
Subject: [PATCH 1/1] bond: check for NULL bond mode value in
fc9aca
 update_connection()
fc9aca
fc9aca
Don't crash if the bond mode can't be read from sysfs - for example
fc9aca
when the interface disappears. The generated connection will be bogus,
fc9aca
but at that point it doesn't matter because the in-memory connection
fc9aca
will be destroyed.
fc9aca
fc9aca
Fixes: 056a973a4fdb68abe8bc7bfc5f31250345d71f21
fc9aca
fc9aca
https://bugzilla.redhat.com/show_bug.cgi?id=1459580
fc9aca
(cherry picked from commit 5600a27c2aa1a69c1c72422937bfd4401217046e)
fc9aca
(cherry picked from commit a3a792dd2253085933ca03e3cb61c37a44a6d304)
fc9aca
---
fc9aca
 src/devices/nm-device-bond.c | 2 +-
fc9aca
 1 file changed, 1 insertion(+), 1 deletion(-)
fc9aca
fc9aca
diff --git a/src/devices/nm-device-bond.c b/src/devices/nm-device-bond.c
fc9aca
index c8748fe..451a4f0 100644
fc9aca
--- a/src/devices/nm-device-bond.c
fc9aca
+++ b/src/devices/nm-device-bond.c
fc9aca
@@ -177,7 +177,7 @@ update_connection (NMDevice *device, NMConnection *connection)
fc9aca
 				*p = '\0';
fc9aca
 		}
fc9aca
 
fc9aca
-		if (nm_streq (*options, NM_SETTING_BOND_OPTION_MODE))
fc9aca
+		if (value && nm_streq (*options, NM_SETTING_BOND_OPTION_MODE))
fc9aca
 			mode = _nm_setting_bond_mode_from_string (value);
fc9aca
 
fc9aca
 		if (!_nm_setting_bond_option_supported (*options, mode))
fc9aca
-- 
fc9aca
2.9.4
fc9aca