summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBeniamino Galvani <bgalvani@redhat.com>2017-06-07 18:51:41 +0200
committerBeniamino Galvani <bgalvani@redhat.com>2017-06-08 09:44:47 +0200
commit5600a27c2aa1a69c1c72422937bfd4401217046e (patch)
treee67d3e8556108a494a763f822c62e3ee27006328
parentf07dca941dc327e11c4252688020d5fd0b9b3567 (diff)
downloadNetworkManager-5600a27c2aa1a69c1c72422937bfd4401217046e.tar.gz
bond: check for NULL bond mode value in update_connection()
Don't crash if the bond mode can't be read from sysfs - for example when the interface disappears. The generated connection will be bogus, but at that point it doesn't matter because the in-memory connection will be destroyed. Fixes: 056a973a4fdb68abe8bc7bfc5f31250345d71f21 https://bugzilla.redhat.com/show_bug.cgi?id=1459580
-rw-r--r--src/devices/nm-device-bond.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/devices/nm-device-bond.c b/src/devices/nm-device-bond.c
index a964fa37d9..73ce460a2e 100644
--- a/src/devices/nm-device-bond.c
+++ b/src/devices/nm-device-bond.c
@@ -177,7 +177,7 @@ update_connection (NMDevice *device, NMConnection *connection)
*p = '\0';
}
- if (nm_streq (*options, NM_SETTING_BOND_OPTION_MODE))
+ if (value && nm_streq (*options, NM_SETTING_BOND_OPTION_MODE))
mode = _nm_setting_bond_mode_from_string (value);
if (!_nm_setting_bond_option_supported (*options, mode))