diff options
Diffstat (limited to 'avahi-core/server.c')
-rw-r--r-- | avahi-core/server.c | 23 |
1 files changed, 8 insertions, 15 deletions
diff --git a/avahi-core/server.c b/avahi-core/server.c index bb625a5..558fec9 100644 --- a/avahi-core/server.c +++ b/avahi-core/server.c @@ -1,5 +1,3 @@ -/* $Id$ */ - /*** This file is part of avahi. @@ -51,6 +49,8 @@ #include "domain-util.h" #include "rr-util.h" +#define AVAHI_DEFAULT_CACHE_ENTRIES_MAX 4096 + static void enum_aux_records(AvahiServer *s, AvahiInterface *i, const char *name, uint16_t type, void (*callback)(AvahiServer *s, AvahiRecord *r, int flush_cache, void* userdata), void* userdata) { assert(s); assert(i); @@ -659,7 +659,6 @@ 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?)"); @@ -669,7 +668,7 @@ static void handle_response_packet(AvahiServer *s, AvahiDnsPacket *p, AvahiInter 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); @@ -680,7 +679,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); @@ -1009,13 +1008,6 @@ static void dispatch_legacy_unicast_packet(AvahiServer *s, AvahiDnsPacket *p) { avahi_dns_packet_set_field(p, AVAHI_DNS_FIELD_ID, slot->id); } -static void cleanup_dead(AvahiServer *s) { - assert(s); - - avahi_cleanup_dead_entries(s); - avahi_browser_cleanup(s); -} - static void mcast_socket_event(AvahiWatch *w, int fd, AvahiWatchEvent events, void *userdata) { AvahiServer *s = userdata; AvahiAddress dest, src; @@ -1044,11 +1036,11 @@ static void mcast_socket_event(AvahiWatch *w, int fd, AvahiWatchEvent events, vo if (iface != AVAHI_IF_UNSPEC) dispatch_packet(s, p, &src, port, &dest, iface, ttl); else - avahi_log_error("Incoming packet recieved on address that isn't local."); + avahi_log_error("Incoming packet received on address that isn't local."); avahi_dns_packet_free(p); - cleanup_dead(s); + avahi_cleanup_dead_entries(s); } } @@ -1071,7 +1063,7 @@ static void legacy_unicast_socket_event(AvahiWatch *w, int fd, AvahiWatchEvent e dispatch_legacy_unicast_packet(s, p); avahi_dns_packet_free(p); - cleanup_dead(s); + avahi_cleanup_dead_entries(s); } } @@ -1593,6 +1585,7 @@ AvahiServerConfig* avahi_server_config_init(AvahiServerConfig *c) { c->allow_point_to_point = 0; c->publish_aaaa_on_ipv4 = 1; c->publish_a_on_ipv6 = 0; + c->n_cache_entries_max = AVAHI_DEFAULT_CACHE_ENTRIES_MAX; return c; } |