diff options
| author | Michael Biebl <biebl@debian.org> | 2017-05-11 14:55:55 +0200 |
|---|---|---|
| committer | Michael Biebl <biebl@debian.org> | 2017-05-11 14:55:55 +0200 |
| commit | c333f062ddcba9b35330647bf6cbd0a07f2d786e (patch) | |
| tree | 257c3a0c74c09f4ad2328eab5b932806405f0c1c /libnm-core/nm-setting-vlan.c | |
| parent | a222e56e103f949b148a6942e385ccca2c26d9f3 (diff) | |
New upstream version 1.8.0 upstream/1.8.0
Diffstat (limited to 'libnm-core/nm-setting-vlan.c')
| -rw-r--r-- | libnm-core/nm-setting-vlan.c | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/libnm-core/nm-setting-vlan.c b/libnm-core/nm-setting-vlan.c index 61264784..de9c5c48 100644 --- a/libnm-core/nm-setting-vlan.c +++ b/libnm-core/nm-setting-vlan.c @@ -290,7 +290,7 @@ nm_setting_vlan_add_priority_str (NMSettingVlan *setting, * @setting: the #NMSettingVlan * @map: the type of priority map * - * Returns the number of entires in the + * Returns the number of entries in the * #NMSettingVlan:ingress_priority_map or #NMSettingVlan:egress_priority_map * properties of this setting. * @@ -577,7 +577,7 @@ nm_setting_vlan_remove_priority_str_by_value (NMSettingVlan *setting, * @setting: the #NMSettingVlan * @map: the type of priority map * - * Clear all the entires from #NMSettingVlan:ingress_priority_map or + * Clear all the entries from #NMSettingVlan:ingress_priority_map or * #NMSettingVlan:egress_priority_map properties. */ void @@ -600,7 +600,7 @@ nm_setting_vlan_init (NMSettingVlan *setting) { } -static gboolean +static int verify (NMSetting *setting, NMConnection *connection, GError **error) { NMSettingVlanPrivate *priv = NM_SETTING_VLAN_GET_PRIVATE (setting); @@ -681,6 +681,18 @@ verify (NMSetting *setting, NMConnection *connection, GError **error) return FALSE; } + if (connection && !s_wired) { + /* technically, a VLAN setting does not require an ethernet setting. However, + * the ifcfg-rh reader always adds a ethernet setting when reading a vlan setting. + * Thus, in order to be consistent, always add one via normalization. */ + g_set_error_literal (error, + NM_CONNECTION_ERROR, + NM_CONNECTION_ERROR_SETTING_NOT_FOUND, + _("vlan setting should have a ethernet setting as well")); + g_prefix_error (error, "%s.%s: ", NM_SETTING_VLAN_SETTING_NAME, NM_SETTING_VLAN_FLAGS); + return NM_SETTING_VERIFY_NORMALIZABLE; + } + return TRUE; } |