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