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