-static void send_goodbye_callback(AvahiInterfaceMonitor *m, AvahiInterface *i, gpointer userdata) {
+static int is_duplicate_entry(AvahiServer *s, AvahiEntry *e) {
+ AvahiEntry *i;
+
+ assert(s);
+ assert(e);
+
+ for (i = avahi_hashmap_lookup(s->entries_by_key, e->record->key); i; i = i->by_key_next) {
+
+ if (i == e)
+ continue;
+
+ if (!avahi_record_equal_no_ttl(i->record, e->record))
+ continue;
+
+ return 1;
+ }
+
+ return 0;
+}
+
+static void send_goodbye_callback(AvahiInterfaceMonitor *m, AvahiInterface *i, void* userdata) {