mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2025-12-25 17:40:08 +01:00
libnm: don't fail assertion for _bond_get_option_normalized() with invalid bond mode
_bond_get_option_normalized() gets called with code paths that don't
assume a valid options hash. That means, the bond mode might be invalid
and we should fail an assertion.
(cherry picked from commit 1543f8a1a1)
This commit is contained in:
parent
45c95e9314
commit
491cd1d2cd
1 changed files with 5 additions and 1 deletions
|
|
@ -262,7 +262,11 @@ _bond_get_option_normalized (NMSettingBond* self,
|
|||
|
||||
mode_str = _bond_get_option_or_default (self, NM_SETTING_BOND_OPTION_MODE);
|
||||
mode = _nm_setting_bond_mode_from_string (mode_str);
|
||||
g_return_val_if_fail (mode != NM_BOND_MODE_UNKNOWN, NULL);
|
||||
if (mode == NM_BOND_MODE_UNKNOWN) {
|
||||
/* the mode is unknown, consequently, there is no normalized/default
|
||||
* value either. */
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (!_nm_setting_bond_option_supported (option, mode))
|
||||
return NULL;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue