Hi,

Here is the new patch.

Regards,
Mateusz Polrola

---
 src/service.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/src/service.c b/src/service.c
index 5c8f9d0..a51d2b3 100644
--- a/src/service.c
+++ b/src/service.c
@@ -5369,10 +5369,6 @@ static int service_indicate_state(struct connman_service 
*service)
                domain_changed(service);
                proxy_changed(service);
 
-               if (old_state == CONNMAN_SERVICE_STATE_READY ||
-                               old_state == CONNMAN_SERVICE_STATE_ONLINE)
-                       __connman_notifier_disconnect(service->type);
-
                /*
                 * Previous services which are connected and which states
                 * are set to online should reset relevantly ipconfig_state
@@ -5384,9 +5380,6 @@ static int service_indicate_state(struct connman_service 
*service)
        }
 
        if (new_state == CONNMAN_SERVICE_STATE_FAILURE) {
-               if (old_state == CONNMAN_SERVICE_STATE_READY ||
-                               old_state == CONNMAN_SERVICE_STATE_ONLINE)
-                       __connman_notifier_disconnect(service->type);
 
                if (service->userconnect &&
                        connman_agent_report_error(service, service->path,
@@ -5406,6 +5399,13 @@ static int service_indicate_state(struct connman_service 
*service)
 
        __connman_connection_update_gateway();
 
+       if((old_state == CONNMAN_SERVICE_STATE_ONLINE && new_state != 
CONNMAN_SERVICE_STATE_READY) ||
+               (old_state == CONNMAN_SERVICE_STATE_READY && new_state != 
CONNMAN_SERVICE_STATE_ONLINE))
+       {
+               __connman_notifier_disconnect(service->type);
+       }
+
+
        if (new_state == CONNMAN_SERVICE_STATE_ONLINE) {
                __connman_notifier_enter_online(service->type);
                default_changed();
-- 
1.7.11.7


Intel GmbH
Dornacher Strasse 1
85622 Feldkirchen/Muenchen, Deutschland
Sitz der Gesellschaft: Feldkirchen bei Muenchen
Geschaeftsfuehrer: Christian Lamprechter, Hannes Schwaderer, Douglas Lusk
Registergericht: Muenchen HRB 47456
Ust.-IdNr./VAT Registration No.: DE129385895
Citibank Frankfurt a.M. (BLZ 502 109 00) 600119052

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

Reply via email to