summary refs log tree commit diff
path: root/libnm-core/nm-setting-ip4-config.c
diff options
context:
space:
mode:
Diffstat (limited to 'libnm-core/nm-setting-ip4-config.c')
-rw-r--r--libnm-core/nm-setting-ip4-config.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/libnm-core/nm-setting-ip4-config.c b/libnm-core/nm-setting-ip4-config.c
index 70fab0e2..91a4a3f5 100644
--- a/libnm-core/nm-setting-ip4-config.c
+++ b/libnm-core/nm-setting-ip4-config.c
@@ -225,6 +225,20 @@ verify (NMSetting *setting, NMConnection *connection, GError **error)
 		return FALSE;
 	}
 
+	/* Failures from here on are NORMALIZABLE_ERROR... */
+
+	if (   nm_streq (method, NM_SETTING_IP4_CONFIG_METHOD_SHARED)
+	    && nm_setting_ip_config_get_num_addresses (s_ip) > 1) {
+		g_set_error (error,
+		             NM_CONNECTION_ERROR,
+		             NM_CONNECTION_ERROR_INVALID_PROPERTY,
+		             _("multiple addresses are not allowed for '%s=%s'"),
+		             NM_SETTING_IP_CONFIG_METHOD,
+		             NM_SETTING_IP4_CONFIG_METHOD_SHARED);
+		g_prefix_error (error, "%s.%s: ", NM_SETTING_IP4_CONFIG_SETTING_NAME, NM_SETTING_IP_CONFIG_ADDRESSES);
+		return NM_SETTING_VERIFY_NORMALIZABLE_ERROR;
+	}
+
 	/* Failures from here on are NORMALIZABLE... */
 
 	if (   !strcmp (method, NM_SETTING_IP4_CONFIG_METHOD_DISABLED)