]> git.meshlink.io Git - catta/commitdiff
core: Don't ignore records with link-local addresss
authorTommaso Colombo <colombo@icascan4.pv.infn.it>
Wed, 27 Jan 2010 01:43:11 +0000 (02:43 +0100)
committerLennart Poettering <lennart@poettering.net>
Fri, 25 Jun 2010 03:36:55 +0000 (05:36 +0200)
Fix a regression introduced by commit
2ea7e99ed0dcfd371fef5aeecd3de77da1dfcd4f that caused the mDNS response
handler to completely ignore records with link-local addresses.

Fixes #300

avahi-core/server.c

index 876984c2e1210308365359f81a5255da21d5e528..6eedd6e8963d68a80af9c569f26d49e1d967b9fe 100644 (file)
@@ -657,17 +657,16 @@ static void handle_response_packet(AvahiServer *s, AvahiDnsPacket *p, AvahiInter
              avahi_dns_packet_get_field(p, AVAHI_DNS_FIELD_ARCOUNT); n > 0; n--) {
         AvahiRecord *record;
         int cache_flush = 0;
-/*         char *txt; */
 
         if (!(record = avahi_dns_packet_consume_record(p, &cache_flush))) {
             avahi_log_warn(__FILE__": Packet too short or invalid while reading response record. (Maybe a UTF-8 problem?)");
             break;
         }
 
-        if (!avahi_key_is_pattern(record->key) && !avahi_record_is_link_local_address(record)) {
+        if (!avahi_key_is_pattern(record->key)) {
 
             if (handle_conflict(s, i, record, cache_flush)) {
-                if (!from_local_iface)
+                if (!from_local_iface && !avahi_record_is_link_local_address(record))
                     reflect_response(s, i, record, cache_flush);
                 avahi_cache_update(i->cache, record, cache_flush, a);
                 avahi_response_scheduler_incoming(i->response_scheduler, record, cache_flush);
@@ -678,7 +677,7 @@ static void handle_response_packet(AvahiServer *s, AvahiDnsPacket *p, AvahiInter
     }
 
     /* If the incoming response contained a conflicting record, some
-       records have been scheduling for sending. We need to flush them
+       records have been scheduled for sending. We need to flush them
        here. */
     if (!avahi_record_list_is_empty(s->record_list))
         avahi_server_generate_response(s, i, NULL, NULL, 0, 0, 1);