Do not stay in FAILURE state as clients like connmand can
get confused about our current state. Symptom for the problem
is that after a failed connect attempt, a new connect attempt
by the client would cause immediately a failure return code
because vpnd is still in FAILURE state. The actual connect
attempt might still succeed but then the client would not
know about the success status.
By setting the state to IDLE we avoid this confusion.
connman_dbus_property_changed_basic(provider->path,
VPN_CONNECTION_INTERFACE, "State",
DBUS_TYPE_STRING, &str);
+ /*
+ * We do not stay in failure state as clients like connmand can
+ * get confused about our current state.
+ */
+ if (provider->state == VPN_PROVIDER_STATE_FAILURE)
+ provider->state = VPN_PROVIDER_STATE_IDLE;
+
return 0;
}