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] agent: Always set driver for queued message.
      (Jussi Laakkonen)


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

Message: 1
Date: Wed, 18 Sep 2019 11:13:47 +0300
From: Jussi Laakkonen <[email protected]>
To: [email protected]
Subject: [PATCH] agent: Always set driver for queued message.
Message-ID: <[email protected]>

This addresses the issue of not being able to cancel agent queries in
case the query timeouts or when component (e.g., a VPN plugin) has
requested something via agent and the component dies when the query is
still active. As a result the queries are stacked on top of another if
the agent creates new one for every query.

It is imperative to always set the driver for the message to be queued
via agent.c because otherwise sending cancel request will fail. This is
because the cancel request would be sent to a NULL interface as driver
is omitted. In this case, following is logged:

connman-vpnd[4835]: src/agent.c:send_cancel_request() send cancel req to
:1.2951 /org/agent/path/vpnagent iface (null)

dbus-daemon[1553]: [system] Rejected send message, 2 matched rules;
type="method_call", sender=":1.3387" (uid=0 pid=4835
comm="/usr/sbin/connman-vpnd -d -n") interface="(unset)" member="Cancel"
error name="(unset)" requested_reply="0" destination=":1.2951"
(uid=100000 pid=27084 comm="/usr/bin/agent")
---
 src/agent.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/agent.c b/src/agent.c
index 8f7b19ba..d6113af7 100644
--- a/src/agent.c
+++ b/src/agent.c
@@ -238,12 +238,12 @@ int connman_agent_queue_message(void *user_context,
        driver = get_driver();
        DBG("driver %p", driver);
 
-       if (driver && driver->context_ref) {
+       if (driver && driver->context_ref)
                queue_data->user_context = driver->context_ref(user_context);
-               queue_data->driver = driver;
-       } else
+       else
                queue_data->user_context = user_context;
 
+       queue_data->driver = driver;
        queue_data->msg = dbus_message_ref(msg);
        queue_data->timeout = timeout;
        queue_data->callback = callback;
-- 
2.20.1



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

Subject: Digest Footer

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


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

End of connman Digest, Vol 47, Issue 10
***************************************

Reply via email to