summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBeniamino Galvani <bgalvani@redhat.com>2019-11-04 14:19:12 +0100
committerBeniamino Galvani <bgalvani@redhat.com>2019-11-04 14:58:48 +0100
commit08c8b04a664f743cc44be58a0689bffe06919fd9 (patch)
tree744943521963bdaa92c8480e5c1cbe2c48c286a5
parent4e34807a8cfd4e6e6314ec75a6e34646b89fad3f (diff)
downloadNetworkManager-bg/arp-announce-rh1767681.tar.gz
acd: poll the acd fd after starting the announcementsbg/arp-announce-rh1767681
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: d9a4b59c18e3 ('acd: adapt NM code and build options') https://bugzilla.redhat.com/show_bug.cgi?id=1767681
-rw-r--r--src/devices/nm-acd-manager.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/devices/nm-acd-manager.c b/src/devices/nm-acd-manager.c
index fe9913c55a..6e7a2a0f61 100644
--- a/src/devices/nm-acd-manager.c
+++ b/src/devices/nm-acd-manager.c
@@ -334,6 +334,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);
@@ -379,6 +381,7 @@ nm_acd_manager_announce_addresses (NMAcdManager *self)
GHashTableIter iter;
AddressInfo *info;
int r;
+ int fd;
gboolean success = TRUE;
r = acd_init (self);
@@ -418,6 +421,13 @@ nm_acd_manager_announce_addresses (NMAcdManager *self)
}
}
+ 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);
+ }
+
return success ? 0 : -NME_UNSPEC;
}