X-Git-Url: http://git.meshlink.io/?a=blobdiff_plain;f=avahi-core%2Fserver.c;h=66cc70592699286d40120494f45b44263729989e;hb=77e36045b7f13654e5dad8b80b3224dd06daede0;hp=dbb861d254e4ed230e9d1885775182ac8ce5d8c1;hpb=07a81966419eeabdcf69c29644e92aa8d99d6b6e;p=catta diff --git a/avahi-core/server.c b/avahi-core/server.c index dbb861d..66cc705 100644 --- a/avahi-core/server.c +++ b/avahi-core/server.c @@ -295,7 +295,30 @@ static int handle_conflict(AvahiServer *s, AvahiInterface *i, AvahiRecord *recor for (e = avahi_hashmap_lookup(s->entries_by_key, record->key); e; e = n) { n = e->by_key_next; - if (e->dead || (!(e->flags & AVAHI_ENTRY_UNIQUE) && !unique)) + if (e->dead) + continue; + + /* Check if the incoming is a goodbye record */ + if (avahi_record_is_goodbye(record)) { + + if (avahi_record_equal_no_ttl(e->record, record)) { + char *t; + + /* Refresh */ + t = avahi_record_to_string(record); + avahi_log_debug("Recieved goodbye record for one of our records [%s]. Refreshing.", t); + avahi_server_prepare_matching_responses(s, i, e->record->key, 0); + + valid = 0; + avahi_free(t); + break; + } + + /* If the goodybe packet doesn't match one of our own RRs, we simply ignore it. */ + continue; + } + + if (!(e->flags & AVAHI_ENTRY_UNIQUE) && !unique) continue; /* Either our entry or the other is intended to be unique, so let's check */