about summary refs log tree commit diff
path: root/src/devices/nm-acd-manager.c
diff options
context:
space:
mode:
authorSebastien Bacher <seb128@ubuntu.com>2020-01-07 16:43:07 +0100
committerSebastien Bacher <seb128@ubuntu.com>2020-01-07 16:43:07 +0100
commita524db35ac5c2099671d16318524e277e88631be (patch)
tree54b29c42a317b9a13c3049ff85b14f7dce734cf6 /src/devices/nm-acd-manager.c
parent6917e28d2d16138d6d497dc96efafe573b4b0979 (diff)
parent724bcc5c7be3aed3646ed2b2989c34d438217176 (diff)
Merge branch 'upstream/latest' of https://salsa.debian.org/utopia-team/network-manager into upstream
Diffstat (limited to 'src/devices/nm-acd-manager.c')
-rw-r--r--src/devices/nm-acd-manager.c26
1 files changed, 13 insertions, 13 deletions
diff --git a/src/devices/nm-acd-manager.c b/src/devices/nm-acd-manager.c
index aca7ffd2..6e7a2a0f 100644
--- a/src/devices/nm-acd-manager.c
+++ b/src/devices/nm-acd-manager.c
@@ -1,16 +1,6 @@
-/* NetworkManager -- Network link manager
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * Copyright (C) 2015-2018 Red Hat, Inc.
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * Copyright (C) 2015 - 2018 Red Hat, Inc.
  */
 
 #include "nm-default.h"
@@ -344,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);
@@ -389,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);
@@ -428,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;
 }