]> git.meshlink.io Git - catta/blobdiff - avahi-core/server.c
netlink: fix wrong use of netlink flags for dump operations
[catta] / avahi-core / server.c
index 569b44eb2c8f6abb389eeaa1acfd3071b7117b11..2b8f95fd56a50a234b5d891eba585391559279ce 100644 (file)
@@ -923,10 +923,9 @@ static void dispatch_packet(AvahiServer *s, AvahiDnsPacket *p, const AvahiAddres
     if (avahi_dns_packet_is_query(p)) {
         int legacy_unicast = 0;
 
-        if (avahi_dns_packet_get_field(p, AVAHI_DNS_FIELD_ARCOUNT) != 0) {
-            avahi_log_warn("Invalid query packet.");
-            return;
-        }
+        /* For queries EDNS0 might allow ARCOUNT != 0. We ignore the
+         * AR section completely here, so far. Until the day we add
+         * EDNS0 support. */
 
         if (port != AVAHI_MDNS_PORT) {
             /* Legacy Unicast */
@@ -1216,6 +1215,7 @@ static void register_stuff(AvahiServer *s) {
     register_browse_domain(s);
     avahi_interface_monitor_update_rrs(s->monitor, 0);
 
+    assert(s->n_host_rr_pending > 0);
     s->n_host_rr_pending --;
 
     if (s->n_host_rr_pending == 0)
@@ -1387,6 +1387,7 @@ AvahiServer *avahi_server_new(const AvahiPoll *poll_api, const AvahiServerConfig
     s->need_entry_cleanup = 0;
     s->need_group_cleanup = 0;
     s->need_browser_cleanup = 0;
+    s->cleanup_time_event = NULL;
     s->hinfo_entry_group = NULL;
     s->browse_domain_entry_group = NULL;
     s->error = AVAHI_OK;
@@ -1486,6 +1487,9 @@ void avahi_server_free(AvahiServer* s) {
         avahi_wide_area_engine_free(s->wide_area_lookup_engine);
     avahi_multicast_lookup_engine_free(s->multicast_lookup_engine);
 
+    if (s->cleanup_time_event)
+        avahi_time_event_free(s->cleanup_time_event);
+
     avahi_time_event_queue_free(s->time_event_queue);
 
     /* Free watches */
@@ -1587,6 +1591,8 @@ AvahiServerConfig* avahi_server_config_init(AvahiServerConfig *c) {
     c->publish_aaaa_on_ipv4 = 1;
     c->publish_a_on_ipv6 = 0;
     c->n_cache_entries_max = AVAHI_DEFAULT_CACHE_ENTRIES_MAX;
+    c->ratelimit_interval = 0;
+    c->ratelimit_burst = 0;
 
     return c;
 }