From 324cd0b9f7d3a66cdd2b6325befc3dd36a49c452 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Tue, 15 Nov 2011 13:06:24 +0200 Subject: [PATCH] l2tp: Check authentication error properly --- plugins/l2tp.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/plugins/l2tp.c b/plugins/l2tp.c index fce8902b..78b8e373 100644 --- a/plugins/l2tp.c +++ b/plugins/l2tp.c @@ -158,6 +158,9 @@ static int l2tp_notify(DBusMessage *msg, struct connman_provider *provider) return VPN_STATE_FAILURE; } + if (strcmp(reason, "auth failed") == 0) + return VPN_STATE_AUTH_FAILURE; + if (strcmp(reason, "connect")) return VPN_STATE_DISCONNECT; @@ -473,12 +476,9 @@ static int l2tp_connect(struct connman_provider *provider, static int l2tp_error_code(int exit_code) { - switch (exit_code) { case 1: return CONNMAN_PROVIDER_ERROR_CONNECT_FAILED; - case 2: - return CONNMAN_PROVIDER_ERROR_LOGIN_FAILED; default: return CONNMAN_PROVIDER_ERROR_UNKNOWN; } -- 2.34.1