Send connman mailing list submissions to
[email protected]
To subscribe or unsubscribe via the World Wide Web, visit
https://lists.01.org/mailman/listinfo/connman
or, via email, send a message with subject or body 'help' to
[email protected]
You can reach the person managing the list at
[email protected]
When replying, please edit your Subject line so it is more specific
than "Re: Contents of connman digest..."
Today's Topics:
1. [PATCH v2 04/10] openconnect: Use vpn-agent.c error
processing for VPN agent errors. (Jussi Laakkonen)
2. [PATCH v2 06/10] vpnc: Use vpn-agent.c error processing for
VPN agent errors. (Jussi Laakkonen)
----------------------------------------------------------------------
Message: 1
Date: Tue, 25 Jun 2019 17:30:16 +0300
From: Jussi Laakkonen <[email protected]>
To: [email protected]
Subject: [PATCH v2 04/10] openconnect: Use vpn-agent.c error
processing for VPN agent errors.
Message-ID: <[email protected]>
Use vpn_agent_check_and_process_reply_error() to check and process VPN
agent errors. Clear callback and pending D-Bus message (user_data) if
error was processed to avoid calling the callback twice.
---
Changes since V2:
* If no reply received go to error.
* Free private data if D-Bus error is received.
vpn/plugins/openconnect.c | 13 ++++++++++++-
1 file changed, 12 insertions(+), 1 deletion(-)
diff --git a/vpn/plugins/openconnect.c b/vpn/plugins/openconnect.c
index 4117471c..b9125ede 100644
--- a/vpn/plugins/openconnect.c
+++ b/vpn/plugins/openconnect.c
@@ -311,12 +311,22 @@ static void request_input_cookie_reply(DBusMessage
*reply, void *user_data)
char *cookie = NULL, *servercert = NULL, *vpnhost = NULL;
char *key;
DBusMessageIter iter, dict;
+ int err_int;
DBG("provider %p", data->provider);
- if (!reply || dbus_message_get_type(reply) == DBUS_MESSAGE_TYPE_ERROR)
+ if (!reply)
goto err;
+ err_int = vpn_agent_check_and_process_reply_error(reply, data->provider,
+ data->task, data->cb, data->user_data);
+ if (err_int) {
+ /* Ensure cb is called only once */
+ data->cb = NULL;
+ data->user_data = NULL;
+ goto out;
+ }
+
if (!vpn_agent_check_reply_has_dict(reply))
goto err;
@@ -387,6 +397,7 @@ err:
vpn_provider_indicate_error(data->provider,
VPN_PROVIDER_ERROR_AUTH_FAILED);
+out:
free_private_data(data);
}
--
2.20.1
------------------------------
Message: 2
Date: Tue, 25 Jun 2019 17:32:32 +0300
From: Jussi Laakkonen <[email protected]>
To: [email protected]
Subject: [PATCH v2 06/10] vpnc: Use vpn-agent.c error processing for
VPN agent errors.
Message-ID: <[email protected]>
Use vpn_agent_check_and_process_reply_error() to check and process VPN
agent errors. Clear callback and pending D-Bus message (user_data) if
error was processed to avoid calling the callback twice.
---
Changes since V2:
* If no reply received stop processing.
* Cleanup goto err.
vpn/plugins/vpnc.c | 44 +++++++++++---------------------------------
1 file changed, 11 insertions(+), 33 deletions(-)
diff --git a/vpn/plugins/vpnc.c b/vpn/plugins/vpnc.c
index f222196a..9f33bb88 100644
--- a/vpn/plugins/vpnc.c
+++ b/vpn/plugins/vpnc.c
@@ -606,28 +606,20 @@ static void request_input_credentials_reply(DBusMessage
*reply, void *user_data)
char *secret = NULL, *username = NULL, *password = NULL;
const char *key;
DBusMessageIter iter, dict;
- DBusError error;
- int err_int = 0;
+ int err_int;
DBG("provider %p", data->provider);
- dbus_error_init(&error);
-
- if (dbus_set_error_from_message(&error, reply)) {
- if (!g_strcmp0(error.name, VPN_AGENT_INTERFACE
- ".Error.Canceled"))
- err_int = ECONNABORTED;
-
- if (!g_strcmp0(error.name, VPN_AGENT_INTERFACE
- ".Error.Timeout"))
- err_int = ETIMEDOUT;
-
- dbus_error_free(&error);
-
- if (err_int)
- goto abort;
-
+ if (!reply)
goto err;
+
+ err_int = vpn_agent_check_and_process_reply_error(reply, data->provider,
+ data->task, data->cb, data->user_data);
+ if (err_int) {
+ /* Ensure cb is called only once */
+ data->cb = NULL;
+ data->user_data = NULL;
+ return;
}
if (!vpn_agent_check_reply_has_dict(reply))
@@ -696,21 +688,7 @@ static void request_input_credentials_reply(DBusMessage
*reply, void *user_data)
return;
err:
- err_int = EACCES;
-
-abort:
- vc_connect_done(data, err_int);
-
- switch (err_int) {
- case EACCES:
- vpn_provider_indicate_error(data->provider,
- VPN_PROVIDER_ERROR_AUTH_FAILED);
- break;
- case ECONNABORTED:
- case ETIMEDOUT:
- vpn_provider_indicate_error(data->provider,
- VPN_PROVIDER_ERROR_UNKNOWN);
- }
+ vc_connect_done(data, EACCES);
}
static int request_input_credentials(struct vc_private_data *data,
--
2.20.1
------------------------------
Subject: Digest Footer
_______________________________________________
connman mailing list
[email protected]
https://lists.01.org/mailman/listinfo/connman
------------------------------
End of connman Digest, Vol 44, Issue 9
**************************************