When a device shows up through rtnl before the device driver is created,
the device's element driver pointer will not be set.
The bug is not visible with built-in devices, it only appears with
removable ones or with those that are completely removed from the bus when
being rfkilled.
int __connman_detect_init(void);
void __connman_detect_cleanup(void);
+void __connman_element_set_driver(struct connman_element *element);
+
#include <connman/ipconfig.h>
int __connman_ipconfig_init(void);
element->device->driver = driver;
+ __connman_element_set_driver(element);
+
setup_device(element->device);
}
__connman_service_indicate_error(service, convert_error(error));
}
+void __connman_element_set_driver(struct connman_element *element)
+{
+ GSList *list;
+
+ DBG("element %p name %s driver %p", element, element->name,
+ element->driver);
+
+ if (element->driver)
+ return;
+
+ for (list = driver_list; list; list = list->next) {
+ struct connman_driver *driver = list->data;
+
+ if (match_driver(element, driver) == FALSE)
+ continue;
+
+ element->driver = driver;
+
+ break;
+ }
+}
+
int __connman_element_init(const char *device, const char *nodevice)
{
struct connman_element *element;