]> git.meshlink.io Git - catta/blobdiff - avahi-core/server.c
avahi-daemon: don't leak host info by default
[catta] / avahi-core / server.c
index d7fd71bc31714dba42825cd285c3d84d6a69a34d..86fd4a551e7341af4d3856687a99dfa6453cc7dd 100644 (file)
@@ -513,12 +513,20 @@ static void reflect_response(AvahiServer *s, AvahiInterface *i, AvahiRecord *r,
 
 static void* reflect_cache_walk_callback(AvahiCache *c, AvahiKey *pattern, AvahiCacheEntry *e, void* userdata) {
     AvahiServer *s = userdata;
+    AvahiRecord* r;
 
     assert(c);
     assert(pattern);
     assert(e);
     assert(s);
 
+    /* Don't reflect cache entry with ipv6 link-local addresses. */
+    r = e->record;
+    if ((r->key->type == AVAHI_DNS_TYPE_AAAA) &&
+            (r->data.aaaa.address.address[0] == 0xFE) &&
+            (r->data.aaaa.address.address[1] == 0x80))
+      return NULL;
+
     avahi_record_list_push(s->record_list, e->record, e->cache_flush, 0, 0);
     return NULL;
 }
@@ -1591,6 +1599,8 @@ AvahiServerConfig* avahi_server_config_init(AvahiServerConfig *c) {
     c->publish_aaaa_on_ipv4 = 1;
     c->publish_a_on_ipv6 = 0;
     c->n_cache_entries_max = AVAHI_DEFAULT_CACHE_ENTRIES_MAX;
+    c->ratelimit_interval = 0;
+    c->ratelimit_burst = 0;
 
     return c;
 }