]> git.meshlink.io Git - catta/commitdiff
reflector: cache entry link-local addresses filter
authorFrançois-Xavier Bourlet <bombela@gmail.com>
Tue, 21 Dec 2010 16:32:35 +0000 (17:32 +0100)
committerLennart Poettering <lennart@poettering.net>
Tue, 8 Mar 2011 21:54:27 +0000 (22:54 +0100)
Do not reflect cache entry with ipv6 link-local addresses on query.

avahi-core/server.c

index 2b8f95fd56a50a234b5d891eba585391559279ce..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;
 }