From: François-Xavier Bourlet Date: Tue, 21 Dec 2010 16:32:35 +0000 (+0100) Subject: reflector: cache entry link-local addresses filter X-Git-Url: https://git.meshlink.io/?a=commitdiff_plain;h=b0f64b072a583f20efa97955f8900ec6d971210d;p=catta reflector: cache entry link-local addresses filter Do not reflect cache entry with ipv6 link-local addresses on query. --- diff --git a/avahi-core/server.c b/avahi-core/server.c index 2b8f95f..86fd4a5 100644 --- a/avahi-core/server.c +++ b/avahi-core/server.c @@ -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; }