summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFran├žois-Xavier Bourlet <bombela@gmail.com>2010-12-21 17:32:35 +0100
committerLennart Poettering <lennart@poettering.net>2011-03-08 22:54:27 +0100
commitb0f64b072a583f20efa97955f8900ec6d971210d (patch)
tree234364df7615574e0853b9f47e2c326dff975dc1
parent94366b4c8e1e4c6b92353cf194cb972086f44a4a (diff)
reflector: cache entry link-local addresses filter
Do not reflect cache entry with ipv6 link-local addresses on query.
-rw-r--r--avahi-core/server.c8
1 files changed, 8 insertions, 0 deletions
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;
}