From 5aea82d383a09d5ea8eba61db2e204adaa2d68da Mon Sep 17 00:00:00 2001 From: Beniamino Galvani Date: Fri, 4 Nov 2016 14:00:44 +0100 Subject: [PATCH] libnm-core: ensure a IP tunnel connection specifies a remote IP The IP of the remote endpoint is always required. --- libnm-core/nm-setting-ip-tunnel.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/libnm-core/nm-setting-ip-tunnel.c b/libnm-core/nm-setting-ip-tunnel.c index 4b78bde05..e7d625c38 100644 --- a/libnm-core/nm-setting-ip-tunnel.c +++ b/libnm-core/nm-setting-ip-tunnel.c @@ -345,7 +345,16 @@ verify (NMSetting *setting, NMConnection *connection, GError **error) return FALSE; } - if (priv->remote && !nm_utils_ipaddr_valid (family, priv->remote)) { + if (!priv->remote) { + g_set_error_literal (error, + NM_CONNECTION_ERROR, + NM_CONNECTION_ERROR_INVALID_PROPERTY, + _("property is missing")); + g_prefix_error (error, "%s.%s: ", NM_SETTING_IP_TUNNEL_SETTING_NAME, NM_SETTING_IP_TUNNEL_REMOTE); + return FALSE; + } + + if (!nm_utils_ipaddr_valid (family, priv->remote)) { g_set_error (error, NM_CONNECTION_ERROR, NM_CONNECTION_ERROR_INVALID_PROPERTY,