if (index != ipconfig->index)
continue;
+ if (ipconfig->ops == NULL)
+ continue;
+
if (up == TRUE && ipconfig->ops->up)
ipconfig->ops->up(ipconfig);
if (lower_up == TRUE && ipconfig->ops->lower_up)
ipconfig->index = -1;
+ if (ipconfig->ops == NULL)
+ continue;
+
if (ipconfig->ops->lower_down)
ipconfig->ops->lower_down(ipconfig);
if (ipconfig->ops->down)
if (index != ipconfig->index)
continue;
+ if (ipconfig->ops == NULL)
+ continue;
+
if (ipconfig->ops->ip_bound)
ipconfig->ops->ip_bound(ipconfig);
}
if (index != ipconfig->index)
continue;
+ if (ipconfig->ops == NULL)
+ continue;
+
if (ipconfig->ops->ip_release)
ipconfig->ops->ip_release(ipconfig);
}
void connman_ipconfig_unref(struct connman_ipconfig *ipconfig)
{
if (g_atomic_int_dec_and_test(&ipconfig->refcount) == TRUE) {
+ __connman_ipconfig_disable(ipconfig);
+
connman_ipconfig_set_ops(ipconfig, NULL);
if (ipconfig->origin != NULL) {
void connman_ipconfig_set_ops(struct connman_ipconfig *ipconfig,
const struct connman_ipconfig_ops *ops)
{
- if (ipconfig->ops != NULL)
- ipconfig_list = g_list_remove(ipconfig_list, ipconfig);
-
ipconfig->ops = ops;
-
- if (ops != NULL)
- ipconfig_list = g_list_append(ipconfig_list, ipconfig);
}
/**
return -ENXIO;
if (ipdevice->config != NULL) {
+ ipconfig_list = g_list_remove(ipconfig_list, ipconfig);
+
connman_ipaddress_clear(ipdevice->config->system);
connman_ipconfig_unref(ipdevice->config);
ipdevice->config = connman_ipconfig_ref(ipconfig);
+ ipconfig_list = g_list_append(ipconfig_list, ipconfig);
+
return 0;
}
if (ipdevice->config == NULL || ipdevice->config != ipconfig)
return -EINVAL;
+ ipconfig_list = g_list_remove(ipconfig_list, ipconfig);
+
connman_ipaddress_clear(ipdevice->config->system);
connman_ipconfig_unref(ipdevice->config);
g_get_current_time(&service->modified);
__connman_storage_save_service(service);
- settings_changed(service);
-
__connman_notifier_connect(service->type);
default_changed();
static void service_ip_bound(struct connman_ipconfig *ipconfig)
{
+ struct connman_service *service = connman_ipconfig_get_data(ipconfig);
+
connman_info("%s ip bound", connman_ipconfig_get_ifname(ipconfig));
+
+ settings_changed(service);
}
static void service_ip_release(struct connman_ipconfig *ipconfig)
{
+ struct connman_service *service = connman_ipconfig_get_data(ipconfig);
+
connman_info("%s ip release", connman_ipconfig_get_ifname(ipconfig));
+
+ settings_changed(service);
}
static const struct connman_ipconfig_ops service_ops = {
connman_ipconfig_set_data(service->ipconfig, service);
connman_ipconfig_set_ops(service->ipconfig, &service_ops);
- connman_ipconfig_set_ops(service->ipconfig, NULL);
}
/**