[network-manager-openvpn: 12/14] 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: 12/14] service: don't return input value from validate_connection_type()
- Date: Wed, 7 Mar 2018 18:10:57 +0000 (UTC)
commit cca47a9adc6e7637c829fd39fb015c915942973d
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 9c28271..88f5636 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]