[network-manager-openvpn/th/extra-certs-and-cleanup: 12/13] service: don't return input value from validate_connection_type()
- From: Thomas Haller <thaller src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [network-manager-openvpn/th/extra-certs-and-cleanup: 12/13] service: don't return input value from validate_connection_type()
- Date: Fri, 23 Feb 2018 11:55:44 +0000 (UTC)
commit 318298f5fd9a8641c008d6eb597dfe237a4eba14
Author: Thomas Haller <thaller redhat com>
Date: Fri Feb 23 12:47:01 2018 +0100
service: don't return input value from validate_connection_type()
It's inconsistent and not needed.
src/nm-openvpn-service.c | 17 +++++++----------
1 files changed, 7 insertions(+), 10 deletions(-)
---
diff --git a/src/nm-openvpn-service.c b/src/nm-openvpn-service.c
index ec6a1f7..36c59ff 100644
--- a/src/nm-openvpn-service.c
+++ b/src/nm-openvpn-service.c
@@ -1063,15 +1063,13 @@ validate_auth (const char *auth)
NM_OPENVPN_AUTH_RIPEMD160);
}
-static const char *
+static gboolean
validate_connection_type (const char *ctype)
{
- if (!NM_IN_STRSET (ctype, NM_OPENVPN_CONTYPE_TLS,
- NM_OPENVPN_CONTYPE_STATIC_KEY,
- NM_OPENVPN_CONTYPE_PASSWORD,
- NM_OPENVPN_CONTYPE_PASSWORD_TLS))
- return NULL;
- return ctype;
+ return NM_IN_STRSET (ctype, NM_OPENVPN_CONTYPE_TLS,
+ NM_OPENVPN_CONTYPE_STATIC_KEY,
+ NM_OPENVPN_CONTYPE_PASSWORD,
+ NM_OPENVPN_CONTYPE_PASSWORD_TLS);
}
static gboolean
@@ -1964,9 +1962,8 @@ check_need_secrets (NMSettingVpn *s_vpn, gboolean *need_secrets)
*need_secrets = FALSE;
- tmp = nm_setting_vpn_get_data_item (s_vpn, NM_OPENVPN_KEY_CONNECTION_TYPE);
- ctype = validate_connection_type (tmp);
- if (!ctype)
+ ctype = nm_setting_vpn_get_data_item (s_vpn, NM_OPENVPN_KEY_CONNECTION_TYPE);
+ if (!validate_connection_type (ctype))
return NULL;
if (nm_streq (ctype, NM_OPENVPN_CONTYPE_PASSWORD_TLS)) {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]