From 01585d2ebe1c0c021fe3b3780e13a82ea6bdcdf3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ji=C5=99=C3=AD=20Klime=C5=A1?= Date: Tue, 18 Jun 2013 10:59:17 +0200 Subject: [PATCH] keyfile: fix reading bonding options (bgo #701527) Bonding options are written straight into [bond] group like: [bond] interface-name=bbb mode-active-backup miimon=300 So we have to handle them explicitly. --- src/settings/plugins/keyfile/reader.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/settings/plugins/keyfile/reader.c b/src/settings/plugins/keyfile/reader.c index 9c85fa93fd..fb0989e5a6 100644 --- a/src/settings/plugins/keyfile/reader.c +++ b/src/settings/plugins/keyfile/reader.c @@ -580,6 +580,10 @@ read_hash_of_string (GKeyFile *file, NMSetting *setting, const char *key) if (strcmp (*iter, NM_SETTING_VPN_SERVICE_TYPE)) nm_setting_vpn_add_data_item (NM_SETTING_VPN (setting), *iter, value); } + if (NM_IS_SETTING_BOND (setting)) { + if (strcmp (*iter, NM_SETTING_BOND_INTERFACE_NAME)) + nm_setting_bond_add_option (NM_SETTING_BOND (setting), *iter, value); + } g_free (value); } g_strfreev (keys); @@ -988,6 +992,10 @@ read_one_setting_value (NMSetting *setting, if (NM_IS_SETTING_VPN (setting)) check_for_key = FALSE; + /* Bonding 'options' don't have the exact key name. The options are right under [bond] group. */ + if (NM_IS_SETTING_BOND (setting)) + check_for_key = FALSE; + /* Check for the exact key in the GKeyFile if required. Most setting * properties map 1:1 to a key in the GKeyFile, but for those properties * like IP addresses and routes where more than one value is actually