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.
This commit is contained in:
Jiří Klimeš 2013-06-18 10:59:17 +02:00
parent 236155d9c9
commit 01585d2ebe

View file

@ -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