diff options
author | Beniamino Galvani <bgalvani@redhat.com> | 2016-11-04 14:00:44 +0100 |
---|---|---|
committer | Beniamino Galvani <bgalvani@redhat.com> | 2016-11-09 17:45:34 +0100 |
commit | 5aea82d383a09d5ea8eba61db2e204adaa2d68da (patch) | |
tree | 0fa4eab1637de40421402602809221bafe9fb9c3 /libnm-core | |
parent | 75127b1348dd9e68716b7e623c210115652b93ee (diff) | |
download | NetworkManager-5aea82d383a09d5ea8eba61db2e204adaa2d68da.tar.gz |
libnm-core: ensure a IP tunnel connection specifies a remote IP
The IP of the remote endpoint is always required.
Diffstat (limited to 'libnm-core')
-rw-r--r-- | libnm-core/nm-setting-ip-tunnel.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/libnm-core/nm-setting-ip-tunnel.c b/libnm-core/nm-setting-ip-tunnel.c index 4b78bde05a..e7d625c381 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, |