|
|
97acb4 |
From dae15bf2b3d7ebef817cacf22bbbc3a0e5ff1424 Mon Sep 17 00:00:00 2001
|
|
|
97acb4 |
From: Beniamino Galvani <bgalvani@redhat.com>
|
|
|
97acb4 |
Date: Mon, 4 Nov 2019 14:19:12 +0100
|
|
|
97acb4 |
Subject: [PATCH] acd: poll the acd fd after starting the announcements
|
|
|
97acb4 |
|
|
|
97acb4 |
In nm_acd_manager_announce_addresses() we should not only start the
|
|
|
97acb4 |
probes but also add the acd file descriptor to the main loop.
|
|
|
97acb4 |
Otherwise, a timer is armed to send the announcements but it never
|
|
|
97acb4 |
fires and no announcements are sent.
|
|
|
97acb4 |
|
|
|
97acb4 |
Fixes: d9a4b59c18e3 ('acd: adapt NM code and build options')
|
|
|
97acb4 |
|
|
|
97acb4 |
https://bugzilla.redhat.com/show_bug.cgi?id=1767681
|
|
|
97acb4 |
(cherry picked from commit 14992ab9cdb6394d133c8ac7b88ad1e4a1e995b0)
|
|
|
97acb4 |
(cherry picked from commit c36da8b990dcb4858e27abf87cc45cf7b550538c)
|
|
|
97acb4 |
(cherry picked from commit 5798b1b814556e0ca224c092fa2887d603703c38)
|
|
|
97acb4 |
---
|
|
|
97acb4 |
src/devices/nm-acd-manager.c | 10 ++++++++++
|
|
|
97acb4 |
1 file changed, 10 insertions(+)
|
|
|
97acb4 |
|
|
|
97acb4 |
diff --git a/src/devices/nm-acd-manager.c b/src/devices/nm-acd-manager.c
|
|
|
97acb4 |
index f437ce3a8..58bf4fd97 100644
|
|
|
97acb4 |
--- a/src/devices/nm-acd-manager.c
|
|
|
97acb4 |
+++ b/src/devices/nm-acd-manager.c
|
|
|
97acb4 |
@@ -345,6 +345,8 @@ nm_acd_manager_start_probe (NMAcdManager *self, guint timeout)
|
|
|
97acb4 |
if (success)
|
|
|
97acb4 |
self->state = STATE_PROBING;
|
|
|
97acb4 |
|
|
|
97acb4 |
+ nm_assert (!self->channel);
|
|
|
97acb4 |
+ nm_assert (self->event_id == 0);
|
|
|
97acb4 |
n_acd_get_fd (self->acd, &fd;;
|
|
|
97acb4 |
self->channel = g_io_channel_unix_new (fd);
|
|
|
97acb4 |
self->event_id = g_io_add_watch (self->channel, G_IO_IN, acd_event, self);
|
|
|
97acb4 |
@@ -390,6 +392,7 @@ nm_acd_manager_announce_addresses (NMAcdManager *self)
|
|
|
97acb4 |
GHashTableIter iter;
|
|
|
97acb4 |
AddressInfo *info;
|
|
|
97acb4 |
int r;
|
|
|
97acb4 |
+ int fd;
|
|
|
97acb4 |
gboolean success = TRUE;
|
|
|
97acb4 |
|
|
|
97acb4 |
r = acd_init (self);
|
|
|
97acb4 |
@@ -429,6 +432,13 @@ nm_acd_manager_announce_addresses (NMAcdManager *self)
|
|
|
97acb4 |
}
|
|
|
97acb4 |
}
|
|
|
97acb4 |
|
|
|
97acb4 |
+ if (!self->channel) {
|
|
|
97acb4 |
+ nm_assert (self->event_id == 0);
|
|
|
97acb4 |
+ n_acd_get_fd (self->acd, &fd;;
|
|
|
97acb4 |
+ self->channel = g_io_channel_unix_new (fd);
|
|
|
97acb4 |
+ self->event_id = g_io_add_watch (self->channel, G_IO_IN, acd_event, self);
|
|
|
97acb4 |
+ }
|
|
|
97acb4 |
+
|
|
|
97acb4 |
return success ? 0 : -NME_UNSPEC;
|
|
|
97acb4 |
}
|
|
|
97acb4 |
|
|
|
97acb4 |
--
|
|
|
97acb4 |
2.21.0
|
|
|
97acb4 |
|