device: don't complain about repeated schedules of the same activation stage

Can easily happend with a storm of DHCP responses or RAs before the idle
handler has a chance to run.

https://bugzilla.redhat.com/show_bug.cgi?id=1269520
This commit is contained in:
Lubomir Rintel
2015-10-07 15:19:21 +02:00
parent 76726b9922
commit 3abe1bb21a

View File

@@ -2814,19 +2814,23 @@ activation_source_schedule (NMDevice *self, GSourceFunc func, int family)
act_source_func = &priv->act_source_func; act_source_func = &priv->act_source_func;
} }
if (*act_source_id) if (*act_source_id) {
_LOGE (LOGD_DEVICE, "activation stage already scheduled"); if (*act_source_func == func) {
/* Don't bother rescheduling the same function that's about to
/* Don't bother rescheduling the same function that's about to * run anyway. Fixes issues with crappy wireless drivers sending
* run anyway. Fixes issues with crappy wireless drivers sending * streams of associate events before NM has had a chance to process
* streams of associate events before NM has had a chance to process * the first one.
* the first one. */
*/ _LOGD (LOGD_DEVICE, "activation stage already scheduled");
if (!*act_source_id || (*act_source_func != func)) { return;
activation_source_clear (self, TRUE, family); } else {
*act_source_id = g_idle_add (func, self); _LOGW (LOGD_DEVICE, "a different activation stage already scheduled");
*act_source_func = func; activation_source_clear (self, TRUE, family);
}
} }
*act_source_id = g_idle_add (func, self);
*act_source_func = func;
} }
static gboolean static gboolean