acd: poll the acd fd after starting the announcements

In nm_acd_manager_announce_addresses() we should not only start the
probes but also add the acd file descriptor to the main loop.
Otherwise, a timer is armed to send the announcements but it never
fires and no announcements are sent.

Fixes: d9a4b59c18 ('acd: adapt NM code and build options')

https://bugzilla.redhat.com/show_bug.cgi?id=1767681
(cherry picked from commit 14992ab9cd)
(cherry picked from commit c36da8b990)
(cherry picked from commit 5798b1b814)
This commit is contained in:
Beniamino Galvani 2019-11-04 14:19:12 +01:00
parent 63c8658215
commit 5ce41f77df

View file

@ -321,6 +321,8 @@ nm_acd_manager_start_probe (NMAcdManager *self, guint timeout)
if (success)
self->state = STATE_PROBING;
nm_assert (!self->channel);
nm_assert (self->event_id == 0);
n_acd_get_fd (self->acd, &fd);
self->channel = g_io_channel_unix_new (fd);
self->event_id = g_io_add_watch (self->channel, G_IO_IN, acd_event, self);
@ -364,6 +366,7 @@ nm_acd_manager_announce_addresses (NMAcdManager *self)
GHashTableIter iter;
AddressInfo *info;
int r;
int fd;
r = acd_init (self);
if (r) {
@ -398,6 +401,13 @@ nm_acd_manager_announce_addresses (NMAcdManager *self)
_LOGD ("announcing address %s", nm_utils_inet4_ntop (info->address, sbuf));
}
}
if (!self->channel) {
nm_assert (self->event_id == 0);
n_acd_get_fd (self->acd, &fd);
self->channel = g_io_channel_unix_new (fd);
self->event_id = g_io_add_watch (self->channel, G_IO_IN, acd_event, self);
}
}
static void