Send connman mailing list submissions to
        connman@lists.01.org

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
        connman-requ...@lists.01.org

You can reach the person managing the list at
        connman-ow...@lists.01.org

When replying, please edit your Subject line so it is more specific
than "Re: Contents of connman digest..."


Today's Topics:

   1. [PATCH] service: do not reply twice to Connect (Beno?t Monin)


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

Message: 1
Date: Sun, 12 Aug 2018 15:11:05 +0200
From: Beno?t Monin <benoit.mo...@gmx.fr>
To: connman@lists.01.org
Subject: [PATCH] service: do not reply twice to Connect
Message-ID:
        
<67acdc3c9d1564b106cc53f6073a200ff9e6bfd9.1534079465.git.benoit.mo...@gmx.fr>
        

Calling Connect an a service sometime triggers the following error message in
the log:

dbus-daemon[591]: [system] Rejected send message, 0 matched rules;
type="method_return", sender=":1.139" (uid=0 pid=27373
comm="/usr/sbin/connmand -n -d ") interface="(unset)" member="(unset)" error
name="(unset)" requested_reply="0" destination=":1.141" (uid=0 pid=27384
comm="/usr/bin/connmanctl ")

This is caused by connmand replying twice to the Connect method. It can be
reproduced by calling connect on a manually configured ethernet service while
checking the dbus exchange with dbus-monitor. The dbus daemon rejects the
second reply since there is no corresponding method call.

Fix this by exiting connect_service before sending another reply if the
pending reply has already been sent.
---
 src/service.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/service.c b/src/service.c
index 1a7576f6..c7f6b7cf 100644
--- a/src/service.c
+++ b/src/service.c
@@ -4339,7 +4339,8 @@ static DBusMessage *connect_service(DBusConnection *conn,
        if (service->pending) {
                dbus_message_unref(service->pending);
                service->pending = NULL;
-       }
+       } else
+               return NULL;
 
        if (err < 0)
                return __connman_error_failed(msg, -err);


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

Subject: Digest Footer

_______________________________________________
connman mailing list
connman@lists.01.org
https://lists.01.org/mailman/listinfo/connman


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

End of connman Digest, Vol 34, Issue 4
**************************************

Reply via email to