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] vpn: Handle stale task completions (Slava Monich)


----------------------------------------------------------------------

Message: 1
Date: Fri, 13 Apr 2018 18:11:44 +0300
From: Slava Monich <[email protected]>
To: [email protected]
Subject: [PATCH] vpn: Handle stale task completions
Message-ID: <[email protected]>

The task may die after we have already started the new one
---
 vpn/plugins/vpn.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/vpn/plugins/vpn.c b/vpn/plugins/vpn.c
index aeb01d6..10548aa 100644
--- a/vpn/plugins/vpn.c
+++ b/vpn/plugins/vpn.c
@@ -133,6 +133,10 @@ void vpn_died(struct connman_task *task, int exit_code, 
void *user_data)
        if (!data)
                goto vpn_exit;
 
+       /* The task may die after we have already started the new one */
+       if (data->task != task)
+               goto done;
+
        state = data->state;
 
        stop_vpn(provider);
@@ -172,6 +176,7 @@ vpn_exit:
                g_free(data);
        }
 
+done:
        connman_task_destroy(task);
 }
 
-- 
1.9.1



------------------------------

Subject: Digest Footer

_______________________________________________
connman mailing list
[email protected]
https://lists.01.org/mailman/listinfo/connman


------------------------------

End of connman Digest, Vol 30, Issue 11
***************************************

Reply via email to