From 91b3eef40a5960a948161daf2b204fa808dc0085 Mon Sep 17 00:00:00 2001 From: Selva Nair Date: Mon, 2 Jan 2017 14:17:25 -0500 Subject: [PATCH] Mark status as connected only if openvpn reports CONNECTED,SUCCESS Avoid reporting a connection that completed with errors (state change message = CONNECTED,ERROR) as successful. Signed-off-by: Selva Nair --- openvpn.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openvpn.c b/openvpn.c index ec636f5..6671434 100644 --- a/openvpn.c +++ b/openvpn.c @@ -191,7 +191,7 @@ OnStateChange(connection_t *c, char *data) return; *pos = '\0'; - if (strcmp(state, "CONNECTED") == 0) + if (strcmp(state, "CONNECTED") == 0 && strcmp(message, "SUCCESS") == 0) { /* Run Connect Script */ if (c->state == connecting || c->state == resuming)