From 3f5b873d23cf44fd46d2f132ebf1f6bb4ae71b1e Mon Sep 17 00:00:00 2001 From: Samuel Ortiz Date: Wed, 8 Sep 2010 16:42:18 +0200 Subject: [PATCH] Try to detect portal even if the location driver is already set With DHCP renewals the ConnMan state can go from Online to Ready and a location detect will start. Since the location driver is already set by then, this will fail and ConnMan's state will be stuck at Ready. Instead of returning an error, the location finish() hooks is called and a new portal detection is triggered. --- src/location.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/location.c b/src/location.c index aee2ea1..6ea8b3e 100644 --- a/src/location.c +++ b/src/location.c @@ -225,8 +225,15 @@ int __connman_location_detect(struct connman_service *service) if (location == NULL) return -EINVAL; - if (location->driver) - return -EBUSY; + if (location->driver) { + location->result = CONNMAN_LOCATION_RESULT_UNKNOWN; + location->driver->finish(location); + + if (location->driver->detect(location) == 0) + return 0; + + location->driver = NULL; + } for (list = driver_list; list; list = list->next) { struct connman_location_driver *driver = list->data; -- 2.7.4