Blame SOURCES/0009-Fix-not-publishing-entries-if-a-probing-interface-is.patch

263faa
From 8d7edcaf79ce5a439f40ca50c020a097cbe8d8eb Mon Sep 17 00:00:00 2001
263faa
From: Nicolas Cavallari <nicolas.cavallari@green-communications.fr>
263faa
Date: Wed, 25 Nov 2015 16:31:39 +0100
263faa
Subject: [PATCH] Fix not publishing entries if a probing interface is removed.
263faa
263faa
If an interface is no longer relevant for mDNS while an announcer was
263faa
probing on this interface, the announcer is removed but the n_probing
263faa
counter of the entry group is not updated.   So n_probing would never
263faa
reach zero and the entry group would stay  forever in the REGISTERING
263faa
state.  If the entry group is for a host resource record,  the daemon
263faa
could stay in the registering phase forever and would not publish any
263faa
service.
263faa
263faa
Fix that by decrementing group->n_probing when removing an announcer
263faa
in the PROBING state. Also handle the case where the entry group was
263faa
waiting for the deleted announcer to become registered.
263faa
263faa
(cherry-picked from PR https://github.com/lathiat/avahi/pull/39)
263faa
263faa
Resolves: #1222646
263faa
---
263faa
 avahi-core/announce.c | 6 ++++++
263faa
 1 file changed, 6 insertions(+)
263faa
263faa
diff --git a/avahi-core/announce.c b/avahi-core/announce.c
263faa
index ccdbf15..05053cf 100644
263faa
--- a/avahi-core/announce.c
263faa
+++ b/avahi-core/announce.c
263faa
@@ -44,6 +44,12 @@ static void remove_announcer(AvahiServer *s, AvahiAnnouncer *a) {
263faa
     AVAHI_LLIST_REMOVE(AvahiAnnouncer, by_interface, a->interface->announcers, a);
263faa
     AVAHI_LLIST_REMOVE(AvahiAnnouncer, by_entry, a->entry->announcers, a);
263faa
 
263faa
+    if (a->state == AVAHI_PROBING && a->entry->group) {
263faa
+	assert(a->entry->group->n_probing);
263faa
+	a->entry->group->n_probing--;
263faa
+	avahi_s_entry_group_check_probed(a->entry->group, 1);
263faa
+    }
263faa
+
263faa
     avahi_free(a);
263faa
 }
263faa
 
263faa
-- 
263faa
2.7.4
263faa