diff options
author | Jiří Klimeš <jklimes@redhat.com> | 2015-12-16 16:12:24 +0100 |
---|---|---|
committer | Jiří Klimeš <jklimes@redhat.com> | 2015-12-16 16:12:24 +0100 |
commit | d0d96c1a13a247fe8435ddf71669848541fa8461 (patch) | |
tree | 7127739ca6eaeefe148e60573ab3b3b767eadfd9 | |
parent | 89db31bf7b7f566f00f700bafa7e6c0093d44f5b (diff) | |
download | NetworkManager-d0d96c1a13a247fe8435ddf71669848541fa8461.tar.gz |
cli: check ip-tunnel mode right after it is read
-rw-r--r-- | clients/cli/connections.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/clients/cli/connections.c b/clients/cli/connections.c index 3441c85ef3..cddaf52731 100644 --- a/clients/cli/connections.c +++ b/clients/cli/connections.c @@ -6177,14 +6177,6 @@ cleanup_tun: goto cleanup_tunnel; } - if (!remote_c && ask) - remote_c = remote_ask = nmc_readline (_("Remote endpoint: ")); - if (!remote_c) { - g_set_error_literal (error, NMCLI_ERROR, NMC_RESULT_ERROR_USER_INPUT, - _("Error: 'remote' is required.")); - goto cleanup_tunnel; - } - if (!nm_utils_enum_from_str (nm_ip_tunnel_mode_get_type (), mode_c, (int *) &mode_enum, NULL)) { gs_free const char **values = NULL; @@ -6200,6 +6192,14 @@ cleanup_tun: goto cleanup_tunnel; } + if (!remote_c && ask) + remote_c = remote_ask = nmc_readline (_("Remote endpoint: ")); + if (!remote_c) { + g_set_error_literal (error, NMCLI_ERROR, NMC_RESULT_ERROR_USER_INPUT, + _("Error: 'remote' is required.")); + goto cleanup_tunnel; + } + if ( !nm_utils_ipaddr_valid (AF_INET, remote_c) && !nm_utils_ipaddr_valid (AF_INET6, remote_c)) { g_set_error (error, NMCLI_ERROR, NMC_RESULT_ERROR_USER_INPUT, |