ip6: ensure IPv6 failures take precedence over success

The RDNSS and DNSSL failure cases wouldn't clear out the idle
handler of a previous success (if that success hadn't fired yet);
it seems pointless to signal success and then immediately fail.
Second, it would cause a dangling GSource if the device was
removed or NM quit at the right time.
This commit is contained in:
Dan Williams 2011-12-01 16:11:04 -06:00
parent 4e1abb8315
commit fc7941032f

View file

@ -111,6 +111,14 @@ typedef struct {
guint32 ra_flags;
} NMIP6Device;
static void
clear_config_changed (NMIP6Device *device)
{
if (device->config_changed_id)
g_source_remove (device->config_changed_id);
device->config_changed_id = 0;
}
static void
nm_ip6_device_destroy (NMIP6Device *device)
{
@ -124,8 +132,9 @@ nm_ip6_device_destroy (NMIP6Device *device)
if (device->finish_addrconf_id)
g_source_remove (device->finish_addrconf_id);
if (device->config_changed_id)
g_source_remove (device->config_changed_id);
clear_config_changed (device);
g_free (device->iface);
if (device->rdnss_servers)
g_array_free (device->rdnss_servers, TRUE);
@ -267,6 +276,7 @@ rdnss_expired (gpointer user_data)
nm_log_dbg (LOGD_IP6, "(%s): IPv6 RDNSS information expired", device->iface);
set_rdnss_timeout (device);
clear_config_changed (device);
emit_config_changed (&info);
return FALSE;
}
@ -321,11 +331,12 @@ static gboolean
dnssl_expired (gpointer user_data)
{
NMIP6Device *device = user_data;
CallbackInfo info = { device, IP6_DHCP_OPT_NONE };
CallbackInfo info = { device, IP6_DHCP_OPT_NONE, FALSE };
nm_log_dbg (LOGD_IP6, "(%s): IPv6 DNSSL information expired", device->iface);
set_dnssl_timeout (device);
clear_config_changed (device);
emit_config_changed (&info);
return FALSE;
}