* Connection Manager
*
* Copyright (C) 2012-2013 Intel Corporation. All rights reserved.
+ * Copyright (C) 2019-2021 Jolla Ltd. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
if (g_strcmp0(error, CONNMAN_ERROR_INTERFACE ".AlreadyConnected") == 0)
return -EISCONN;
+ if (g_strcmp0(error, CONNMAN_ERROR_INTERFACE ".NoCarrier") == 0)
+ return -ENOLINK;
+
if (g_strcmp0(error, CONNMAN_ERROR_INTERFACE ".OperationCanceled") == 0)
return -ECANCELED;
if (dbus_set_error_from_message(&error, reply)) {
int err = errorstr2val(error.name);
+ switch (err) {
+ case -EINPROGRESS:
+ break;
/*
* ECANCELED means that user has canceled authentication
* dialog. That's not really an error, it's part of a normal
* workflow. We also take it as a request to turn autoconnect
* off, in case if it was on.
*/
- if (err == -ECANCELED) {
+ case -ECANCELED:
DBG("%s connect canceled", data->path);
connman_provider_set_autoconnect(data->provider, false);
- } else if (err != -EINPROGRESS) {
+ break;
+ case -ENOLINK: /* vpnd reports that connmand is not online. */
+ case -EISCONN:
+ case -ECONNREFUSED:
+ default:
connman_error("Connect reply: %s (%s)", error.message,
error.name);
DBG("data %p cb_data %p", data, cb_data);
if (data->disconnect_call) {
DBG("already disconnecting");
- return -EINVAL;
+ return -EALREADY;
}
message = dbus_message_new_method_call(VPN_SERVICE, data->path,