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.
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;