diff options
| author | Lennart Poettering <lennart@poettering.net> | 2010-06-25 23:12:26 +0200 | 
|---|---|---|
| committer | Lennart Poettering <lennart@poettering.net> | 2010-06-25 23:12:26 +0200 | 
| commit | 037ca37a213d9e40258f5ebc3b00113df9f842d1 (patch) | |
| tree | 4afc37ea2f5c75ccfd9b6377fe013956cb385531 | |
| parent | 2f56f8a0943f92d430c8f395880ace8f5922f85b (diff) | |
daemon: make internal limits configurable
| -rw-r--r-- | avahi-core/cache.c | 7 | ||||
| -rw-r--r-- | avahi-core/core.h | 1 | ||||
| -rw-r--r-- | avahi-core/server.c | 3 | ||||
| -rw-r--r-- | avahi-daemon/avahi-daemon.conf | 6 | ||||
| -rw-r--r-- | avahi-daemon/dbus-async-address-resolver.c | 2 | ||||
| -rw-r--r-- | avahi-daemon/dbus-async-host-name-resolver.c | 3 | ||||
| -rw-r--r-- | avahi-daemon/dbus-async-service-resolver.c | 3 | ||||
| -rw-r--r-- | avahi-daemon/dbus-domain-browser.c | 3 | ||||
| -rw-r--r-- | avahi-daemon/dbus-entry-group.c | 12 | ||||
| -rw-r--r-- | avahi-daemon/dbus-internal.h | 18 | ||||
| -rw-r--r-- | avahi-daemon/dbus-protocol.c | 44 | ||||
| -rw-r--r-- | avahi-daemon/dbus-protocol.h | 7 | ||||
| -rw-r--r-- | avahi-daemon/dbus-record-browser.c | 2 | ||||
| -rw-r--r-- | avahi-daemon/dbus-service-browser.c | 2 | ||||
| -rw-r--r-- | avahi-daemon/dbus-service-type-browser.c | 4 | ||||
| -rw-r--r-- | avahi-daemon/dbus-sync-address-resolver.c | 2 | ||||
| -rw-r--r-- | avahi-daemon/dbus-sync-host-name-resolver.c | 2 | ||||
| -rw-r--r-- | avahi-daemon/dbus-sync-service-resolver.c | 2 | ||||
| -rw-r--r-- | avahi-daemon/main.c | 71 | ||||
| -rw-r--r-- | man/avahi-daemon.conf.5.xml.in | 652 | 
20 files changed, 479 insertions, 367 deletions
diff --git a/avahi-core/cache.c b/avahi-core/cache.c index c074579..454aac5 100644 --- a/avahi-core/cache.c +++ b/avahi-core/cache.c @@ -32,8 +32,6 @@  #include "log.h"  #include "rr-util.h" -#define AVAHI_CACHE_ENTRIES_MAX 500 -  static void remove_entry(AvahiCache *c, AvahiCacheEntry *e) {      AvahiCacheEntry *t; @@ -340,7 +338,7 @@ void avahi_cache_update(AvahiCache *c, AvahiRecord *r, int cache_flush, const Av  /*             avahi_log_debug("cache: couldn't find matching cache entry for %s", txt);   */ -            if (c->n_entries >= AVAHI_CACHE_ENTRIES_MAX) +            if (c->n_entries >= c->server->config.n_cache_entries_max)                  return;              if (!(e = avahi_new(AvahiCacheEntry, 1))) { @@ -513,6 +511,3 @@ void avahi_cache_stop_poof(AvahiCache *c, AvahiRecord *record, const AvahiAddres              next_expiry(c, e, 80);          }  } - - - diff --git a/avahi-core/core.h b/avahi-core/core.h index 28de917..1f50126 100644 --- a/avahi-core/core.h +++ b/avahi-core/core.h @@ -65,6 +65,7 @@ typedef struct AvahiServerConfig {      int allow_point_to_point;         /**< Enable publishing on POINTOPOINT interfaces */      int publish_a_on_ipv6;            /**< Publish an IPv4 A RR on IPv6 sockets */      int publish_aaaa_on_ipv4;         /**< Publish an IPv4 A RR on IPv6 sockets */ +    unsigned n_cache_entries_max;     /**< Maximum number of cache entries per interface */  } AvahiServerConfig;  /** Allocate a new mDNS responder object. */ diff --git a/avahi-core/server.c b/avahi-core/server.c index 6eedd6e..938c54d 100644 --- a/avahi-core/server.c +++ b/avahi-core/server.c @@ -49,6 +49,8 @@  #include "domain-util.h"  #include "rr-util.h" +#define AVAHI_DEFAULT_CACHE_ENTRIES_MAX 500 +  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); @@ -1583,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;  } diff --git a/avahi-daemon/avahi-daemon.conf b/avahi-daemon/avahi-daemon.conf index 38f1d49..b3185c7 100644 --- a/avahi-daemon/avahi-daemon.conf +++ b/avahi-daemon/avahi-daemon.conf @@ -1,5 +1,5 @@  # This file is part of avahi. -#  +#  # avahi is free software; you can redistribute it and/or modify it  # under the terms of the GNU Lesser General Public License as  # published by the Free Software Foundation; either version 2 of the @@ -31,6 +31,10 @@ use-ipv6=no  #enable-dbus=yes  #disallow-other-stacks=no  #allow-point-to-point=no +#cache-entries-max=500 +#clients-max=256 +#objects-per-client-max=250 +#entries-per-entry-group-max=20  [wide-area]  enable-wide-area=yes diff --git a/avahi-daemon/dbus-async-address-resolver.c b/avahi-daemon/dbus-async-address-resolver.c index 1959841..dcb15e7 100644 --- a/avahi-daemon/dbus-async-address-resolver.c +++ b/avahi-daemon/dbus-async-address-resolver.c @@ -44,8 +44,8 @@ void avahi_dbus_async_address_resolver_free(AsyncAddressResolverInfo *i) {      AVAHI_LLIST_REMOVE(AsyncAddressResolverInfo, async_address_resolvers, i->client->async_address_resolvers, i); +    assert(i->client->n_objects >= 1);      i->client->n_objects--; -    assert(i->client->n_objects >= 0);      avahi_free(i);  } diff --git a/avahi-daemon/dbus-async-host-name-resolver.c b/avahi-daemon/dbus-async-host-name-resolver.c index 7f8adb6..936c3f9 100644 --- a/avahi-daemon/dbus-async-host-name-resolver.c +++ b/avahi-daemon/dbus-async-host-name-resolver.c @@ -43,8 +43,8 @@ void avahi_dbus_async_host_name_resolver_free(AsyncHostNameResolverInfo *i) {      }      AVAHI_LLIST_REMOVE(AsyncHostNameResolverInfo, async_host_name_resolvers, i->client->async_host_name_resolvers, i); +    assert(i->client->n_objects >= 1);      i->client->n_objects--; -    assert(i->client->n_objects >= 0);      avahi_free(i);  } @@ -133,4 +133,3 @@ fail:      return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;  } - diff --git a/avahi-daemon/dbus-async-service-resolver.c b/avahi-daemon/dbus-async-service-resolver.c index 462f9b3..023543d 100644 --- a/avahi-daemon/dbus-async-service-resolver.c +++ b/avahi-daemon/dbus-async-service-resolver.c @@ -44,8 +44,8 @@ void avahi_dbus_async_service_resolver_free(AsyncServiceResolverInfo *i) {      AVAHI_LLIST_REMOVE(AsyncServiceResolverInfo, async_service_resolvers, i->client->async_service_resolvers, i); +    assert(i->client->n_objects >= 1);      i->client->n_objects--; -    assert(i->client->n_objects >= 0);      avahi_free(i);  } @@ -172,4 +172,3 @@ fail:      return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;  } - diff --git a/avahi-daemon/dbus-domain-browser.c b/avahi-daemon/dbus-domain-browser.c index 8c698b0..80155b2 100644 --- a/avahi-daemon/dbus-domain-browser.c +++ b/avahi-daemon/dbus-domain-browser.c @@ -44,8 +44,8 @@ void avahi_dbus_domain_browser_free(DomainBrowserInfo *i) {      AVAHI_LLIST_REMOVE(DomainBrowserInfo, domain_browsers, i->client->domain_browsers, i); +    assert(i->client->n_objects >= 1);      i->client->n_objects--; -    assert(i->client->n_objects >= 0);      avahi_free(i);  } @@ -125,4 +125,3 @@ void avahi_dbus_domain_browser_callback(AvahiSDomainBrowser *b, AvahiIfIndex int      dbus_connection_send(server->bus, m, NULL);      dbus_message_unref(m);  } - diff --git a/avahi-daemon/dbus-entry-group.c b/avahi-daemon/dbus-entry-group.c index b2fb165..45c9be3 100644 --- a/avahi-daemon/dbus-entry-group.c +++ b/avahi-daemon/dbus-entry-group.c @@ -45,8 +45,8 @@ void avahi_dbus_entry_group_free(EntryGroupInfo *i) {      }      AVAHI_LLIST_REMOVE(EntryGroupInfo, entry_groups, i->client->entry_groups, i); +    assert(i->client->n_objects >= 1);      i->client->n_objects--; -    assert(i->client->n_objects >= 0);      avahi_free(i);  } @@ -135,7 +135,7 @@ DBusHandlerResult avahi_dbus_msg_entry_group_impl(DBusConnection *c, DBusMessage          }          avahi_s_entry_group_reset(i->entry_group); -	i->n_entries = 0; +        i->n_entries = 0;          return avahi_dbus_respond_ok(c, m);      } else if (dbus_message_is_method_call(m, AVAHI_DBUS_INTERFACE_ENTRY_GROUP, "IsEmpty")) { @@ -182,7 +182,7 @@ DBusHandlerResult avahi_dbus_msg_entry_group_impl(DBusConnection *c, DBusMessage              goto fail;          } -        if (!(flags & AVAHI_PUBLISH_UPDATE) && i->n_entries >= ENTRIES_PER_ENTRY_GROUP_MAX) { +        if (!(flags & AVAHI_PUBLISH_UPDATE) && i->n_entries >= server->n_entries_per_entry_group_max) {              avahi_string_list_free(strlst);              return avahi_dbus_respond_error(c, m, AVAHI_ERR_TOO_MANY_ENTRIES, NULL);          } @@ -225,7 +225,7 @@ DBusHandlerResult avahi_dbus_msg_entry_group_impl(DBusConnection *c, DBusMessage              goto fail;          } -        if (!(flags & AVAHI_PUBLISH_UPDATE) && i->n_entries >= ENTRIES_PER_ENTRY_GROUP_MAX) +        if (!(flags & AVAHI_PUBLISH_UPDATE) && i->n_entries >= server->n_entries_per_entry_group_max)              return avahi_dbus_respond_error(c, m, AVAHI_ERR_TOO_MANY_ENTRIES, NULL);          if (domain && !*domain) @@ -290,7 +290,7 @@ DBusHandlerResult avahi_dbus_msg_entry_group_impl(DBusConnection *c, DBusMessage              goto fail;          } -        if (!(flags & AVAHI_PUBLISH_UPDATE) && i->n_entries >= ENTRIES_PER_ENTRY_GROUP_MAX) +        if (!(flags & AVAHI_PUBLISH_UPDATE) && i->n_entries >= server->n_entries_per_entry_group_max)              return avahi_dbus_respond_error(c, m, AVAHI_ERR_TOO_MANY_ENTRIES, NULL);          if (!(avahi_address_parse(address, AVAHI_PROTO_UNSPEC, &a))) @@ -326,7 +326,7 @@ DBusHandlerResult avahi_dbus_msg_entry_group_impl(DBusConnection *c, DBusMessage              goto fail;          } -        if (!(flags & AVAHI_PUBLISH_UPDATE) && i->n_entries >= ENTRIES_PER_ENTRY_GROUP_MAX) +        if (!(flags & AVAHI_PUBLISH_UPDATE) && i->n_entries >= server->n_entries_per_entry_group_max)              return avahi_dbus_respond_error(c, m, AVAHI_ERR_TOO_MANY_ENTRIES, NULL);          if (!avahi_is_valid_domain_name (name)) diff --git a/avahi-daemon/dbus-internal.h b/avahi-daemon/dbus-internal.h index d721d38..a786d62 100644 --- a/avahi-daemon/dbus-internal.h +++ b/avahi-daemon/dbus-internal.h @@ -43,9 +43,9 @@ typedef struct SyncServiceResolverInfo SyncServiceResolverInfo;  typedef struct AsyncServiceResolverInfo AsyncServiceResolverInfo;  typedef struct RecordBrowserInfo RecordBrowserInfo; -#define CLIENTS_MAX 256 -#define OBJECTS_PER_CLIENT_MAX 250 -#define ENTRIES_PER_ENTRY_GROUP_MAX 20 +#define DEFAULT_CLIENTS_MAX 256 +#define DEFAULT_OBJECTS_PER_CLIENT_MAX 250 +#define DEFAULT_ENTRIES_PER_ENTRY_GROUP_MAX 20  struct EntryGroupInfo {      unsigned id; @@ -53,7 +53,7 @@ struct EntryGroupInfo {      AvahiSEntryGroup *entry_group;      char *path; -    int n_entries; +    unsigned n_entries;      AVAHI_LLIST_FIELDS(EntryGroupInfo, entry_groups);  }; @@ -149,7 +149,7 @@ struct Client {      unsigned id;      char *name;      unsigned current_id; -    int n_objects; +    unsigned n_objects;      AVAHI_LLIST_FIELDS(Client, clients);      AVAHI_LLIST_HEAD(EntryGroupInfo, entry_groups); @@ -169,11 +169,17 @@ struct Server {      const AvahiPoll *poll_api;      DBusConnection *bus;      AVAHI_LLIST_HEAD(Client, clients); -    int n_clients; +    unsigned n_clients;      unsigned current_id;      AvahiTimeout *reconnect_timeout;      int reconnect; + +    unsigned n_clients_max; +    unsigned n_objects_per_client_max; +    unsigned n_entries_per_entry_group_max; + +    int disable_user_service_publishing;  };  extern Server *server; diff --git a/avahi-daemon/dbus-protocol.c b/avahi-daemon/dbus-protocol.c index 283c27b..937e64d 100644 --- a/avahi-daemon/dbus-protocol.c +++ b/avahi-daemon/dbus-protocol.c @@ -63,8 +63,6 @@  Server *server = NULL; -static int disable_user_service_publishing = 0; -  static int dbus_connect(void);  static void dbus_disconnect(void); @@ -112,8 +110,8 @@ static void client_free(Client *c) {      AVAHI_LLIST_REMOVE(Client, clients, server->clients, c);      avahi_free(c); +    assert(server->n_clients >= 1);      server->n_clients --; -    assert(server->n_clients >= 0);  }  static Client *client_get(const char *name, int create) { @@ -129,7 +127,7 @@ static Client *client_get(const char *name, int create) {      if (!create)          return NULL; -    if (server->n_clients >= CLIENTS_MAX) +    if (server->n_clients >= server->n_clients_max)          return NULL;      /* If not existent yet, create a new entry */ @@ -344,7 +342,7 @@ static DBusHandlerResult msg_server_impl(DBusConnection *c, DBusMessage *m, AVAH      } else if (dbus_message_is_method_call(m, AVAHI_DBUS_INTERFACE_SERVER, "GetNetworkInterfaceNameByIndex")) {          int32_t idx; -	char name[IF_NAMESIZE]; +        char name[IF_NAMESIZE];          if (!(dbus_message_get_args(m, &error, DBUS_TYPE_INT32, &idx, DBUS_TYPE_INVALID))) {              avahi_log_warn("Error parsing Server::GetNetworkInterfaceNameByIndex message"); @@ -429,7 +427,7 @@ static DBusHandlerResult msg_server_impl(DBusConnection *c, DBusMessage *m, AVAH              goto fail;          } -        if (disable_user_service_publishing) +        if (server->disable_user_service_publishing)              return avahi_dbus_respond_error(c, m, AVAHI_ERR_NOT_PERMITTED, NULL);          if (!(client = client_get(dbus_message_get_sender(m), TRUE))) { @@ -437,7 +435,7 @@ static DBusHandlerResult msg_server_impl(DBusConnection *c, DBusMessage *m, AVAH              return avahi_dbus_respond_error(c, m, AVAHI_ERR_TOO_MANY_CLIENTS, NULL);          } -        if (client->n_objects >= OBJECTS_PER_CLIENT_MAX) { +        if (client->n_objects >= server->n_objects_per_client_max) {              avahi_log_warn("Too many objects for client '%s', client request failed.", client->name);              return avahi_dbus_respond_error(c, m, AVAHI_ERR_TOO_MANY_OBJECTS, NULL);          } @@ -483,7 +481,7 @@ static DBusHandlerResult msg_server_impl(DBusConnection *c, DBusMessage *m, AVAH              return avahi_dbus_respond_error(c, m, AVAHI_ERR_TOO_MANY_CLIENTS, NULL);          } -        if (client->n_objects >= OBJECTS_PER_CLIENT_MAX) { +        if (client->n_objects >= server->n_objects_per_client_max) {              avahi_log_warn("Too many objects for client '%s', client request failed.", client->name);              return avahi_dbus_respond_error(c, m, AVAHI_ERR_TOO_MANY_OBJECTS, NULL);          } @@ -528,7 +526,7 @@ static DBusHandlerResult msg_server_impl(DBusConnection *c, DBusMessage *m, AVAH              return avahi_dbus_respond_error(c, m, AVAHI_ERR_TOO_MANY_CLIENTS, NULL);          } -        if (client->n_objects >= OBJECTS_PER_CLIENT_MAX) { +        if (client->n_objects >= server->n_objects_per_client_max) {              avahi_log_warn("Too many objects for client '%s', client request failed.", client->name);              return avahi_dbus_respond_error(c, m, AVAHI_ERR_TOO_MANY_OBJECTS, NULL);          } @@ -578,7 +576,7 @@ static DBusHandlerResult msg_server_impl(DBusConnection *c, DBusMessage *m, AVAH              return avahi_dbus_respond_error(c, m, AVAHI_ERR_TOO_MANY_CLIENTS, NULL);          } -        if (client->n_objects >= OBJECTS_PER_CLIENT_MAX) { +        if (client->n_objects >= server->n_objects_per_client_max) {              avahi_log_warn("Too many objects for client '%s', client request failed.", client->name);              return avahi_dbus_respond_error(c, m, AVAHI_ERR_TOO_MANY_OBJECTS, NULL);          } @@ -633,7 +631,7 @@ static DBusHandlerResult msg_server_impl(DBusConnection *c, DBusMessage *m, AVAH              return avahi_dbus_respond_error(c, m, AVAHI_ERR_TOO_MANY_CLIENTS, NULL);          } -        if (client->n_objects >= OBJECTS_PER_CLIENT_MAX) { +        if (client->n_objects >= server->n_objects_per_client_max) {              avahi_log_warn("Too many objects for client '%s', client request failed.", client->name);              return avahi_dbus_respond_error(c, m, AVAHI_ERR_TOO_MANY_OBJECTS, NULL);          } @@ -689,7 +687,7 @@ static DBusHandlerResult msg_server_impl(DBusConnection *c, DBusMessage *m, AVAH              return avahi_dbus_respond_error(c, m, AVAHI_ERR_TOO_MANY_CLIENTS, NULL);          } -        if (client->n_objects >= OBJECTS_PER_CLIENT_MAX) { +        if (client->n_objects >= server->n_objects_per_client_max) {              avahi_log_warn("Too many objects for client '%s', client request failed.", client->name);              return avahi_dbus_respond_error(c, m, AVAHI_ERR_TOO_MANY_OBJECTS, NULL);          } @@ -739,7 +737,7 @@ static DBusHandlerResult msg_server_impl(DBusConnection *c, DBusMessage *m, AVAH              return avahi_dbus_respond_error(c, m, AVAHI_ERR_TOO_MANY_CLIENTS, NULL);          } -        if (client->n_objects >= OBJECTS_PER_CLIENT_MAX) { +        if (client->n_objects >= server->n_objects_per_client_max) {              avahi_log_warn("Too many objects for client '%s', client request failed.", client->name);              return avahi_dbus_respond_error(c, m, AVAHI_ERR_TOO_MANY_OBJECTS, NULL);          } @@ -797,7 +795,7 @@ static DBusHandlerResult msg_server_impl(DBusConnection *c, DBusMessage *m, AVAH              return avahi_dbus_respond_error(c, m, AVAHI_ERR_TOO_MANY_CLIENTS, NULL);          } -        if (client->n_objects >= OBJECTS_PER_CLIENT_MAX) { +        if (client->n_objects >= server->n_objects_per_client_max) {              avahi_log_warn(__FILE__": Too many objects for client '%s', client request failed.", client->name);              return avahi_dbus_respond_error(c, m, AVAHI_ERR_TOO_MANY_OBJECTS, NULL);          } @@ -858,7 +856,7 @@ static DBusHandlerResult msg_server_impl(DBusConnection *c, DBusMessage *m, AVAH              return avahi_dbus_respond_error(c, m, AVAHI_ERR_TOO_MANY_CLIENTS, NULL);          } -        if (client->n_objects >= OBJECTS_PER_CLIENT_MAX) { +        if (client->n_objects >= server->n_objects_per_client_max) {              avahi_log_warn(__FILE__": Too many objects for client '%s', client request failed.", client->name);              return avahi_dbus_respond_error(c, m, AVAHI_ERR_TOO_MANY_OBJECTS, NULL);          } @@ -914,7 +912,7 @@ static DBusHandlerResult msg_server_impl(DBusConnection *c, DBusMessage *m, AVAH              return avahi_dbus_respond_error(c, m, AVAHI_ERR_TOO_MANY_CLIENTS, NULL);          } -        if (client->n_objects >= OBJECTS_PER_CLIENT_MAX) { +        if (client->n_objects >= server->n_objects_per_client_max) {              avahi_log_warn(__FILE__": Too many objects for client '%s', client request failed.", client->name);              return avahi_dbus_respond_error(c, m, AVAHI_ERR_TOO_MANY_OBJECTS, NULL);          } @@ -973,7 +971,7 @@ static DBusHandlerResult msg_server_impl(DBusConnection *c, DBusMessage *m, AVAH              return avahi_dbus_respond_error(c, m, AVAHI_ERR_TOO_MANY_CLIENTS, NULL);          } -        if (client->n_objects >= OBJECTS_PER_CLIENT_MAX) { +        if (client->n_objects >= server->n_objects_per_client_max) {              avahi_log_warn("Too many objects for client '%s', client request failed.", client->name);              return avahi_dbus_respond_error(c, m, AVAHI_ERR_TOO_MANY_OBJECTS, NULL);          } @@ -1157,9 +1155,13 @@ static void dbus_disconnect(void) {      }  } -int dbus_protocol_setup(const AvahiPoll *poll_api, int _disable_user_service_publishing, int force) { +int dbus_protocol_setup(const AvahiPoll *poll_api, +                        int _disable_user_service_publishing, +                        int _n_clients_max, +                        int _n_objects_per_client_max, +                        int _n_entries_per_entry_group_max, +                        int force) { -    disable_user_service_publishing = _disable_user_service_publishing;      server = avahi_new(Server, 1);      AVAHI_LLIST_HEAD_INIT(Clients, server->clients); @@ -1169,6 +1171,10 @@ int dbus_protocol_setup(const AvahiPoll *poll_api, int _disable_user_service_pub      server->poll_api = poll_api;      server->reconnect_timeout = NULL;      server->reconnect = force; +    server->disable_user_service_publishing = _disable_user_service_publishing; +    server->n_clients_max = _n_clients_max > 0 ? _n_clients_max : DEFAULT_CLIENTS_MAX; +    server->n_objects_per_client_max = _n_objects_per_client_max > 0 ? _n_objects_per_client_max : DEFAULT_OBJECTS_PER_CLIENT_MAX; +    server->n_entries_per_entry_group_max = _n_entries_per_entry_group_max > 0 ? _n_entries_per_entry_group_max : DEFAULT_ENTRIES_PER_ENTRY_GROUP_MAX;      if (dbus_connect() < 0) {          struct timeval tv; diff --git a/avahi-daemon/dbus-protocol.h b/avahi-daemon/dbus-protocol.h index 66b2f74..2184487 100644 --- a/avahi-daemon/dbus-protocol.h +++ b/avahi-daemon/dbus-protocol.h @@ -20,7 +20,12 @@    USA.  ***/ -int dbus_protocol_setup(const AvahiPoll *poll_api, int disable_user_service_publishing, int force); +int dbus_protocol_setup(const AvahiPoll *poll_api, +                        int _disable_user_service_publishing, +                        int _n_clients_max, +                        int _n_objects_per_client_max, +                        int _n_entries_per_entry_group_max, +                        int force);  void dbus_protocol_shutdown(void);  void dbus_protocol_server_state_changed(AvahiServerState state); diff --git a/avahi-daemon/dbus-record-browser.c b/avahi-daemon/dbus-record-browser.c index 752510b..57be6e8 100644 --- a/avahi-daemon/dbus-record-browser.c +++ b/avahi-daemon/dbus-record-browser.c @@ -43,8 +43,8 @@ void avahi_dbus_record_browser_free(RecordBrowserInfo *i) {      }      AVAHI_LLIST_REMOVE(RecordBrowserInfo, record_browsers, i->client->record_browsers, i); +    assert(i->client->n_objects >= 1);      i->client->n_objects--; -    assert(i->client->n_objects >= 0);      avahi_free(i);  } diff --git a/avahi-daemon/dbus-service-browser.c b/avahi-daemon/dbus-service-browser.c index 39251f5..f945e65 100644 --- a/avahi-daemon/dbus-service-browser.c +++ b/avahi-daemon/dbus-service-browser.c @@ -44,8 +44,8 @@ void avahi_dbus_service_browser_free(ServiceBrowserInfo *i) {      AVAHI_LLIST_REMOVE(ServiceBrowserInfo, service_browsers, i->client->service_browsers, i); +    assert(i->client->n_objects >= 1);      i->client->n_objects--; -    assert(i->client->n_objects >= 0);      avahi_free(i);  } diff --git a/avahi-daemon/dbus-service-type-browser.c b/avahi-daemon/dbus-service-type-browser.c index db7a038..ce4787f 100644 --- a/avahi-daemon/dbus-service-type-browser.c +++ b/avahi-daemon/dbus-service-type-browser.c @@ -44,8 +44,8 @@ void avahi_dbus_service_type_browser_free(ServiceTypeBrowserInfo *i) {      AVAHI_LLIST_REMOVE(ServiceTypeBrowserInfo, service_type_browsers, i->client->service_type_browsers, i); +    assert(i->client->n_objects >= 1);      i->client->n_objects--; -    assert(i->client->n_objects >= 0);      avahi_free(i);  } @@ -127,5 +127,3 @@ void avahi_dbus_service_type_browser_callback(AvahiSServiceTypeBrowser *b, Avahi      dbus_connection_send(server->bus, m, NULL);      dbus_message_unref(m);  } - - diff --git a/avahi-daemon/dbus-sync-address-resolver.c b/avahi-daemon/dbus-sync-address-resolver.c index c35711b..5cad5a7 100644 --- a/avahi-daemon/dbus-sync-address-resolver.c +++ b/avahi-daemon/dbus-sync-address-resolver.c @@ -40,8 +40,8 @@ void avahi_dbus_sync_address_resolver_free(SyncAddressResolverInfo *i) {      dbus_message_unref(i->message);      AVAHI_LLIST_REMOVE(SyncAddressResolverInfo, sync_address_resolvers, i->client->sync_address_resolvers, i); +    assert(i->client->n_objects >= 1);      i->client->n_objects--; -    assert(i->client->n_objects >= 0);      avahi_free(i);  } diff --git a/avahi-daemon/dbus-sync-host-name-resolver.c b/avahi-daemon/dbus-sync-host-name-resolver.c index 16b6451..febbd25 100644 --- a/avahi-daemon/dbus-sync-host-name-resolver.c +++ b/avahi-daemon/dbus-sync-host-name-resolver.c @@ -40,8 +40,8 @@ void avahi_dbus_sync_host_name_resolver_free(SyncHostNameResolverInfo *i) {      dbus_message_unref(i->message);      AVAHI_LLIST_REMOVE(SyncHostNameResolverInfo, sync_host_name_resolvers, i->client->sync_host_name_resolvers, i); +    assert(i->client->n_objects >= 1);      i->client->n_objects--; -    assert(i->client->n_objects >= 0);      avahi_free(i);  } diff --git a/avahi-daemon/dbus-sync-service-resolver.c b/avahi-daemon/dbus-sync-service-resolver.c index 719cbaa..6d39d4e 100644 --- a/avahi-daemon/dbus-sync-service-resolver.c +++ b/avahi-daemon/dbus-sync-service-resolver.c @@ -40,8 +40,8 @@ void avahi_dbus_sync_service_resolver_free(SyncServiceResolverInfo *i) {      dbus_message_unref(i->message);      AVAHI_LLIST_REMOVE(SyncServiceResolverInfo, sync_service_resolvers, i->client->sync_service_resolvers, i); +    assert(i->client->n_objects >= 1);      i->client->n_objects--; -    assert(i->client->n_objects >= 0);      avahi_free(i);  } diff --git a/avahi-daemon/main.c b/avahi-daemon/main.c index d270c31..d1a3b3e 100644 --- a/avahi-daemon/main.c +++ b/avahi-daemon/main.c @@ -106,6 +106,9 @@ typedef struct {  #ifdef HAVE_DBUS      int enable_dbus;      int fail_on_missing_dbus; +    unsigned n_clients_max; +    unsigned n_objects_per_client_max; +    unsigned n_entries_per_entry_group_max;  #endif      int drop_root;      int set_rlimits; @@ -527,6 +530,26 @@ static int is_yes(const char *s) {      return *s == 'y' || *s == 'Y' || *s == '1' || *s == 't' || *s == 'T';  } +static int parse_unsigned(const char *s, unsigned *u) { +    char *e = NULL; +    unsigned long ul; +    unsigned k; + +    errno = 0; +    ul = strtoul(s, &e, 0); + +    if (!e || *e || errno != 0) +        return -1; + +    k = (unsigned) ul; + +    if ((unsigned long) k != ul) +        return -1; + +    *u = k; +    return 0; +} +  static int load_config_file(DaemonConfig *c) {      int r = -1;      AvahiIniFile *f; @@ -618,6 +641,44 @@ static int load_config_file(DaemonConfig *c) {                          c->server_config.deny_interfaces = avahi_string_list_add(c->server_config.deny_interfaces, *t);                      avahi_strfreev(e); +                } else if (strcasecmp(p->key, "cache-entries-max") == 0) { +                    unsigned k; + +                    if (parse_unsigned(p->value, &k) < 0) { +                        avahi_log_error("Invalid cache-entries-max setting %s", p->value); +                        goto finish; +                    } + +                    c->server_config.n_cache_entries_max = k; +#ifdef HAVE_DBUS +                } else if (strcasecmp(p->key, "clients-max") == 0) { +                    unsigned k; + +                    if (parse_unsigned(p->value, &k) < 0) { +                        avahi_log_error("Invalid clients-max setting %s", p->value); +                        goto finish; +                    } + +                    c->n_clients_max = k; +                } else if (strcasecmp(p->key, "objects-per-client-max") == 0) { +                    unsigned k; + +                    if (parse_unsigned(p->value, &k) < 0) { +                        avahi_log_error("Invalid objects-per-client-max setting %s", p->value); +                        goto finish; +                    } + +                    c->n_objects_per_client_max = k; +                } else if (strcasecmp(p->key, "entries-per-entry-group-max") == 0) { +                    unsigned k; + +                    if (parse_unsigned(p->value, &k) < 0) { +                        avahi_log_error("Invalid entries-per-entry-group-max setting %s", p->value); +                        goto finish; +                    } + +                    c->n_entries_per_entry_group_max = k; +#endif                  } else {                      avahi_log_error("Invalid configuration key \"%s\" in group \"%s\"\n", p->key, g->name);                      goto finish; @@ -1009,7 +1070,12 @@ static int run_server(DaemonConfig *c) {  #ifdef HAVE_DBUS      if (c->enable_dbus) { -        if (dbus_protocol_setup(poll_api, config.disable_user_service_publishing, !c->fail_on_missing_dbus +        if (dbus_protocol_setup(poll_api, +                                config.disable_user_service_publishing, +                                config.n_clients_max, +                                config.n_objects_per_client_max, +                                config.n_entries_per_entry_group_max, +                                !c->fail_on_missing_dbus  #ifdef ENABLE_CHROOT                                  && !config.use_chroot  #endif @@ -1347,6 +1413,9 @@ int main(int argc, char *argv[]) {  #ifdef HAVE_DBUS      config.enable_dbus = 1;      config.fail_on_missing_dbus = 1; +    config.n_clients_max = 0; +    config.n_objects_per_client_max = 0; +    config.n_entries_per_entry_group_max = 0;  #endif      config.drop_root = 1; diff --git a/man/avahi-daemon.conf.5.xml.in b/man/avahi-daemon.conf.5.xml.in index 7e44690..3c8153e 100644 --- a/man/avahi-daemon.conf.5.xml.in +++ b/man/avahi-daemon.conf.5.xml.in @@ -21,315 +21,343 @@    USA.  --> -  <manpage name="avahi-daemon.conf" section="5" desc="avahi-daemon configuration file"> - -	<synopsis> -      <cmd>@pkgsysconfdir@/avahi-daemon.conf</cmd> -	</synopsis> - -    <description> -      <p><file>avahi-daemon.conf</file> is the configuration file for avahi-daemon.</p> -	</description> - -	<section name="Section [Server]"> - -      <option> -        <p><opt>host-name=</opt> Set the host name avahi-daemon tries -        to register on the LAN. If omited defaults to the system host -        name as set with the sethostname() system call.</p> -      </option> - -      <option> -        <p><opt>domain-name=</opt> Set the default domain name avahi-daemon -        tries to register its host name and services on the LAN in. If -        omitted defaults to ".local".</p> -      </option> - -      <option> -        <p><opt>browse-domains=</opt> Set a comma separated list of -        browsing domains (in addition to the default one and those -        announced inside the default browsing domain). Please note -        that the user may specify additional browsing domains on the -        client side, either by setting $AVAHI_BROWSE_DOMAINS to a list -        of colon separated domains or by adding them to the XDG config -        file <file>~/.config/avahi/browse-domains</file> (separated by -        newlines).</p> - -      </option> - -      <option> -        <p><opt>use-ipv4=</opt> Takes a boolean value ("yes" or -        "no"). If set to "no" avahi-daemon will not use IPv4 -        sockets. Default is "yes".</p> -      </option> - -      <option> -        <p><opt>use-ipv6=</opt> Takes a boolean value ("yes" or -        "no"). If set to "no" avahi-daemon will not use IPv6 -        sockets. Default is "yes".</p> -      </option> - -      <option> -        <p><opt>allow-interfaces=</opt> Set a comma separated list of -        allowed network interfaces that should be used by the -        avahi-daemon.  Other interfaces will be ignored. If set to the -        empty list all local interfaces except loopback and -        point-to-point will be used.</p> -      </option> - -      <option> -        <p><opt>deny-interfaces=</opt> Set a comma separated list of -        network interfaces that should be ignored by avahi-daemon. -	Other not specified interfaces will be used, unless -	<opt>allow-interfaces</opt> is set. This option takes -	precedence over <opt>deny-interfaces</opt>.</p> -      </option> - -      <option> -        <p><opt>check-response-ttl=</opt> Takes a boolean value ("yes" -        or "no"). If set to "yes", an additional security check is -        activated: incoming IP packets will be ignored unless the IP -        TTL is 255. Earlier mDNS specifications required this -        check. Since this feature may be incompatible with newer -        implementations of mDNS it defaults to "no". On the other hand -        it provides extra security.</p> -      </option> - -      <option> -        <p><opt>use-iff-running=</opt> Takes a boolean value ("yes" or -        "no"). If set to "yes" avahi-daemon monitors the IFF_RUNNING -        flag bit which is used by some (modern) network drivers to -        tell user space if a network cable is plugged in (in case of -        copper ethernet), or the network card is associated with some -        kind of network (in case of WLAN). If IFF_RUNNING is set -        avahi-daemon will automatically announce its services on that -        network. Unfortunately far too many network drivers do not -        support this flag or support it in a broken way. Therefore -        this option defaults to "no".</p> -      </option> - -      <option> -        <p><opt>enable-dbus=</opt> Takes either "yes", "no" or -        "warn". If set to "yes" avahi-daemon connects to D-Bus, -        offering an object oriented client API. It is only available -        if Avahi has been compiled with <opt>--enable-dbus</opt> in -        which case it defaults to "yes". "warn" behaves like "yes", -        but the daemon starts up even when it fails to connect to a -        D-Bus daemon. In addition, if the connection to the D-Bus -        daemon is terminated we try to reconnect. (Unless we are in a -        chroot() environment where this definitely will fail.) </p> -      </option> - -      <option> -        <p><opt>disallow-other-stacks=</opt> Takes a boolean value -        ("yes" or "no"). If set to "yes" no other process is allowed -        to bind to UDP port 5353. This effectively impedes other mDNS -        stacks from running on the host. Use this as a security -        measure to make sure that only Avahi is responsible for mDNS -        traffic. Please note that we do not recommend running multiple -        mDNS stacks on the same host simultaneously. This hampers -        reliability and is a waste of resources. However, to not annoy -        people this option defaults to "no".</p> -      </option> - -      <option> -        <p><opt>allow-point-to-point=</opt> Takes a boolean value -        ("yes" or "no"). If set to "yes" avahi-daemon will make use of -        interfaces with the POINTOPOINT flag set. This option defaults -        to "no" as it might make mDNS unreliable due to usually large -        latencies with such links and opens a potential security hole -        by allowing mDNS access from Internet connections. Use with -        care and YMMV!</p> -      </option> - -	</section> - -	<section name="Section [wide-area]"> -      <option> -        <p><opt>enable-wide-area=</opt> Takes a boolean value -        ("yes" or "no"). Enable wide-area DNS-SD, aka -        DNS-SD over unicast DNS. If this is enabled only domains -        ending in .local will be resolved on mDNS, all other domains -        are resolved via unicast DNS. If you want to maintain multiple -        different multicast DNS domains even with this option enabled -        we encourage you to use subdomains of .local, such as -        "kitchen.local". This option defaults to "yes".</p> -      </option> - -    </section> - -	<section name="Section [publish]"> - -      <option><p><opt>disable-publishing=</opt> Takes a boolean value -      ("yes" or "no"). If set to "yes", no record will be published by -      Avahi, not even address records for the local host. Avahi will -      be started in a querying-only mode. Use this is a security -      measure. This option defaults to "no"</p></option> - -      <option><p><opt>disable-user-service-publishing=</opt> Takes a boolean value -      ("yes" or "no"). If set to "yes", Avahi will still publish -      address records and suchlike but will not allow user -      applications to publish services. Use this is a security -      measure. This option defaults to "no"</p></option> - -      <option> -        <p><opt>add-service-cookie=</opt> Takes a boolean value ("yes" -        or "no"). If set to "yes" an implicit TXT entry will be added -        to all locally registered services, containing a cookie value -        which is chosen randomly on daemon startup. This can be used -        to detect if two services on two different -        interfaces/protocols are actually identical. Defaults to -        "no".</p> -      </option> - -      <option> -        <p><opt>publish-addresses=</opt> Takes a boolean value ("yes" -        or "no"). If set to "yes" avahi-daemon will register mDNS -        address records for all local IP addresses. Unless you want to -        use avahi-daemon exclusively for browsing it's recommended to -        enable this. If you plan to register local services you need -        to enable this option. Defaults to "yes".</p> -      </option> - -      <option> -        <p><opt>publish-hinfo=</opt> Takes a boolean value ("yes" or -        "no"). If set to "yes" avahi-daemon will register an mDNS -        HINFO record on all interfaces which contains information -        about the local operating system and CPU, which might be -        useful for administrative purposes. This is recommended by the -        mDNS specification but not required. For the sake of privacy -        you might choose to disable this feature. Defaults to -        "yes."</p> -      </option> - -      <option> -        <p><opt>publish-workstation=</opt> Takes a boolean value -        ("yes" or "no"). If set to "yes" avahi-daemon will register a -        service of type "_workstation._tcp" on the local LAN. This -        might be useful for administrative purposes (i.e. browse for -        all PCs on the LAN), but is not required or recommended by any -        specification. Newer MacOS X releases register a service of -        this type. Defaults to "yes".</p> -      </option> - -      <option> -        <p><opt>publish-domain=</opt> Takes a boolean value ("yes" or -        "no"). If set to "yes" avahi-daemon will announce the locally -        used domain name (see above) for browsing by other -        hosts. Defaults to "yes".</p> -      </option> - -      <option> -        <p><opt>publish-dns-servers=</opt> Takes a comma separated -        list of IP addresses for unicast DNS servers. You can use this -        to announce unicast DNS servers via mDNS. When used in -        conjunction with avahi-dnsconfd on the client -        side this allows DHCP-like configuration of unicast DNS -        servers.</p> -      </option> - -      <option> -        <p><opt>publish-resolv-conf-dns-servers=</opt> Takes a boolean -        value ("yes" or "no"). If set to "yes" avahi-daemon will -        publish the unicast DNS servers specified in -        <file>/etc/resolv.conf</file> in addition to those specified -        with <opt>publish-dns-servers</opt>. Send avahi-daemon a -        SIGHUP to have it reload this file. Defaults to "no".</p> -      </option> - -      <option> -        <p><opt>publish-aaaa-on-ipv4=</opt> Takes a boolean value -        ("yes" or "no"). If set to "yes" avahi-daemon will publish an -        IPv6 AAAA record via IPv4, i.e. the local IPv6 addresses can be -        resolved using an IPv4 transport. Only useful when IPv4 is -        enabled with <opt>use-ipv4=true</opt>. Defaults to "yes".</p> -      </option> - -      <option> -        <p><opt>publish-a-on-ipv6=</opt> Takes a boolean value -        ("yes" or "no"). If set to "yes" avahi-daemon will publish an -        IPv4 A record via IPv6, i.e. the local IPv4 addresses can be -        resolved using an IPv6 transport. Only useful when IPv6 is -        enabled with <opt>use-ipv6=true</opt>. Defaults to "no".</p> -      </option> - -    </section> - -	<section name="Section [reflector]"> -      <option> -        <p><opt>enable-reflector=</opt> Takes a boolean value ("yes" -        or "no"). If set to "yes" avahi-daemon will reflect incoming -        mDNS requests to all local network interfaces, effectively -        allowing clients to browse mDNS/DNS-SD services on all -        networks connected to the gateway. The gateway is somewhat -        intelligent and should work with all kinds of mDNS traffic, -        though some functionality is lost (specifically the unicast -        reply bit, which is used rarely anyway). Make sure to not run -        multiple reflectors between the same networks, this might -        cause them to play Ping Pong with mDNS packets. Defaults to -        "no".</p> -      </option> - -      <option> -        <p><opt>reflect-ipv=</opt> Takes a boolean value ("yes" or -        "no"). If set to "yes" and <opt>enable-reflector</opt> is -        enabled, avahi-daemon will forward mDNS traffic between IPv4 -        and IPv6, which is usually not recommended. Defaults to "no".</p> -      </option> -    </section> - -    <section name="Section [rlimits]"> -      <p>This section is used to define system resource limits for the -      daemon. See <manref section="2" name="setrlimit"/> for more -      information. If any of the options is not specified in the configuration -      file, avahi-daemon does not change it from the system -      defaults.</p> - - -      <option> -        <p><opt>rlimit-as=</opt> Value in bytes for RLIMIT_AS (maximum size of the process's virtual memory). Sensible values are heavily system dependent.</p> -      </option> - -      <option> -        <p><opt>rlimit-core=</opt> Value in bytes for RLIMIT_CORE (maximum core file size). Unless you want to debug avahi-daemon, it is safe to set this to 0.</p> -      </option> - -      <option> -        <p><opt>rlimit-data=</opt> Value in bytes for RLIMIT_DATA (maximum size of the process's data segment). Sensible values are heavily system dependent.</p> -      </option> - -      <option> -        <p><opt>rlimit-fsize=</opt> Value for RLIMIT_FSIZE (maximum size of files the process may create). Since avahi-daemon shouldn't write any files to disk, it is safe to set this to 0.</p> -      </option> - -      <option> -        <p><opt>rlimit-nofile=</opt> Value for RLIMIT_NOFILE (open file descriptors). avahi-daemon shouldn't need more than 15 to 20 open file descriptors concurrently.</p> -      </option> - -      <option> -        <p><opt>rlimit-stack=</opt> Value in bytes for RLIMIT_STACK (maximum size of the process stack). Sensible values are heavily system dependent.</p> -      </option> - -      <option> -        <p><opt>rlimit-nproc=</opt> Value for RLIMIT_NPROC (number of process of user). avahi-daemon forks of a helper process on systems where <manref name="chroot" section="2"/> is available. Therefore this value should not be set below 2.</p> -      </option> - -    </section> - -	<section name="Authors"> -	  <p>The Avahi Developers <@PACKAGE_BUGREPORT@>; Avahi is -	  available from <url href="@PACKAGE_URL@"/></p> -	</section> - -	<section name="See also"> -	  <p> -        <manref name="avahi-daemon" section="8"/>, <manref name="avahi-dnsconfd" section="8"/> -	  </p> -	</section> - -	<section name="Comments"> -	  <p>This man page was written using <manref name="xml2man" section="1" -		  href="http://masqmail.cx/xml2man/"/> by Oliver Kurth.</p> -	</section> - -  </manpage> +<manpage name="avahi-daemon.conf" section="5" desc="avahi-daemon configuration file"> + +  <synopsis> +    <cmd>@pkgsysconfdir@/avahi-daemon.conf</cmd> +  </synopsis> + +  <description> +    <p><file>avahi-daemon.conf</file> is the configuration file for avahi-daemon.</p> +  </description> + +  <section name="Section [Server]"> + +    <option> +      <p><opt>host-name=</opt> Set the host name avahi-daemon tries +      to register on the LAN. If omited defaults to the system host +      name as set with the sethostname() system call.</p> +    </option> + +    <option> +      <p><opt>domain-name=</opt> Set the default domain name avahi-daemon +      tries to register its host name and services on the LAN in. If +      omitted defaults to ".local".</p> +    </option> + +    <option> +      <p><opt>browse-domains=</opt> Set a comma separated list of +      browsing domains (in addition to the default one and those +      announced inside the default browsing domain). Please note +      that the user may specify additional browsing domains on the +      client side, either by setting $AVAHI_BROWSE_DOMAINS to a list +      of colon separated domains or by adding them to the XDG config +      file <file>~/.config/avahi/browse-domains</file> (separated by +      newlines).</p> + +    </option> + +    <option> +      <p><opt>use-ipv4=</opt> Takes a boolean value ("yes" or +      "no"). If set to "no" avahi-daemon will not use IPv4 +      sockets. Default is "yes".</p> +    </option> + +    <option> +      <p><opt>use-ipv6=</opt> Takes a boolean value ("yes" or +      "no"). If set to "no" avahi-daemon will not use IPv6 +      sockets. Default is "yes".</p> +    </option> + +    <option> +      <p><opt>allow-interfaces=</opt> Set a comma separated list of +      allowed network interfaces that should be used by the +      avahi-daemon.  Other interfaces will be ignored. If set to the +      empty list all local interfaces except loopback and +      point-to-point will be used.</p> +    </option> + +    <option> +      <p><opt>deny-interfaces=</opt> Set a comma separated list of +      network interfaces that should be ignored by avahi-daemon. +      Other not specified interfaces will be used, unless +      <opt>allow-interfaces</opt> is set. This option takes +      precedence over <opt>deny-interfaces</opt>.</p> +    </option> + +    <option> +      <p><opt>check-response-ttl=</opt> Takes a boolean value ("yes" +      or "no"). If set to "yes", an additional security check is +      activated: incoming IP packets will be ignored unless the IP +      TTL is 255. Earlier mDNS specifications required this +      check. Since this feature may be incompatible with newer +      implementations of mDNS it defaults to "no". On the other hand +      it provides extra security.</p> +    </option> + +    <option> +      <p><opt>use-iff-running=</opt> Takes a boolean value ("yes" or +      "no"). If set to "yes" avahi-daemon monitors the IFF_RUNNING +      flag bit which is used by some (modern) network drivers to +      tell user space if a network cable is plugged in (in case of +      copper ethernet), or the network card is associated with some +      kind of network (in case of WLAN). If IFF_RUNNING is set +      avahi-daemon will automatically announce its services on that +      network. Unfortunately far too many network drivers do not +      support this flag or support it in a broken way. Therefore +      this option defaults to "no".</p> +    </option> + +    <option> +      <p><opt>enable-dbus=</opt> Takes either "yes", "no" or +      "warn". If set to "yes" avahi-daemon connects to D-Bus, +      offering an object oriented client API. It is only available +      if Avahi has been compiled with <opt>--enable-dbus</opt> in +      which case it defaults to "yes". "warn" behaves like "yes", +      but the daemon starts up even when it fails to connect to a +      D-Bus daemon. In addition, if the connection to the D-Bus +      daemon is terminated we try to reconnect. (Unless we are in a +      chroot() environment where this definitely will fail.) </p> +    </option> + +    <option> +      <p><opt>disallow-other-stacks=</opt> Takes a boolean value +      ("yes" or "no"). If set to "yes" no other process is allowed +      to bind to UDP port 5353. This effectively impedes other mDNS +      stacks from running on the host. Use this as a security +      measure to make sure that only Avahi is responsible for mDNS +      traffic. Please note that we do not recommend running multiple +      mDNS stacks on the same host simultaneously. This hampers +      reliability and is a waste of resources. However, to not annoy +      people this option defaults to "no".</p> +    </option> + +    <option> +      <p><opt>allow-point-to-point=</opt> Takes a boolean value +      ("yes" or "no"). If set to "yes" avahi-daemon will make use of +      interfaces with the POINTOPOINT flag set. This option defaults +      to "no" as it might make mDNS unreliable due to usually large +      latencies with such links and opens a potential security hole +      by allowing mDNS access from Internet connections. Use with +      care and YMMV!</p> +    </option> + +    <option> +      <p><opt>cache-entries-max=</opt> Takes an unsigned integer +      specifying how many resource records are cached per +      interface. Bigger values allow mDNS work correctly in large LANs +      but also increase memory consumption.</p> +    </option> + +    <option> +      <p><opt>clients-max=</opt> Takes an unsigned integer. The +      maximum number of concurrent D-Bus clients allowed. If the +      maximum number is reached further clients will be refused until +      at least one existing client disconnects.</p> +    </option> + +    <option> +      <p><opt>objects-per-client-max=</opt> Takes an unsigned +      integer. The maximum number of objects (entry groups, browsers, +      resolvers) that may be registered per client at a time. If the +      maximum number is reached further object creation will be +      refused until at least one object is freed.</p> +    </option> + +    <option> +      <p><opt>entries-per-entry-group-max=</opt> Takes an unsigned +      integer. The maximum number of entries (resource records) per +      entry group at a time. If the maximum number is reached further +      resource records may not be added to an entry group.</p> +    </option> + +  </section> + +  <section name="Section [wide-area]"> +    <option> +      <p><opt>enable-wide-area=</opt> Takes a boolean value +      ("yes" or "no"). Enable wide-area DNS-SD, aka +      DNS-SD over unicast DNS. If this is enabled only domains +      ending in .local will be resolved on mDNS, all other domains +      are resolved via unicast DNS. If you want to maintain multiple +      different multicast DNS domains even with this option enabled +      we encourage you to use subdomains of .local, such as +      "kitchen.local". This option defaults to "yes".</p> +    </option> + +  </section> + +  <section name="Section [publish]"> + +    <option><p><opt>disable-publishing=</opt> Takes a boolean value +    ("yes" or "no"). If set to "yes", no record will be published by +    Avahi, not even address records for the local host. Avahi will +    be started in a querying-only mode. Use this is a security +    measure. This option defaults to "no"</p></option> + +    <option><p><opt>disable-user-service-publishing=</opt> Takes a boolean value +    ("yes" or "no"). If set to "yes", Avahi will still publish +    address records and suchlike but will not allow user +    applications to publish services. Use this is a security +    measure. This option defaults to "no"</p></option> + +    <option> +      <p><opt>add-service-cookie=</opt> Takes a boolean value ("yes" +      or "no"). If set to "yes" an implicit TXT entry will be added +      to all locally registered services, containing a cookie value +      which is chosen randomly on daemon startup. This can be used +      to detect if two services on two different +      interfaces/protocols are actually identical. Defaults to +      "no".</p> +    </option> + +    <option> +      <p><opt>publish-addresses=</opt> Takes a boolean value ("yes" +      or "no"). If set to "yes" avahi-daemon will register mDNS +      address records for all local IP addresses. Unless you want to +      use avahi-daemon exclusively for browsing it's recommended to +      enable this. If you plan to register local services you need +      to enable this option. Defaults to "yes".</p> +    </option> + +    <option> +      <p><opt>publish-hinfo=</opt> Takes a boolean value ("yes" or +      "no"). If set to "yes" avahi-daemon will register an mDNS +      HINFO record on all interfaces which contains information +      about the local operating system and CPU, which might be +      useful for administrative purposes. This is recommended by the +      mDNS specification but not required. For the sake of privacy +      you might choose to disable this feature. Defaults to +      "yes."</p> +    </option> + +    <option> +      <p><opt>publish-workstation=</opt> Takes a boolean value +      ("yes" or "no"). If set to "yes" avahi-daemon will register a +      service of type "_workstation._tcp" on the local LAN. This +      might be useful for administrative purposes (i.e. browse for +      all PCs on the LAN), but is not required or recommended by any +      specification. Newer MacOS X releases register a service of +      this type. Defaults to "yes".</p> +    </option> + +    <option> +      <p><opt>publish-domain=</opt> Takes a boolean value ("yes" or +      "no"). If set to "yes" avahi-daemon will announce the locally +      used domain name (see above) for browsing by other +      hosts. Defaults to "yes".</p> +    </option> + +    <option> +      <p><opt>publish-dns-servers=</opt> Takes a comma separated +      list of IP addresses for unicast DNS servers. You can use this +      to announce unicast DNS servers via mDNS. When used in +      conjunction with avahi-dnsconfd on the client +      side this allows DHCP-like configuration of unicast DNS +      servers.</p> +    </option> + +    <option> +      <p><opt>publish-resolv-conf-dns-servers=</opt> Takes a boolean +      value ("yes" or "no"). If set to "yes" avahi-daemon will +      publish the unicast DNS servers specified in +      <file>/etc/resolv.conf</file> in addition to those specified +      with <opt>publish-dns-servers</opt>. Send avahi-daemon a +      SIGHUP to have it reload this file. Defaults to "no".</p> +    </option> + +    <option> +      <p><opt>publish-aaaa-on-ipv4=</opt> Takes a boolean value +      ("yes" or "no"). If set to "yes" avahi-daemon will publish an +      IPv6 AAAA record via IPv4, i.e. the local IPv6 addresses can be +      resolved using an IPv4 transport. Only useful when IPv4 is +      enabled with <opt>use-ipv4=true</opt>. Defaults to "yes".</p> +    </option> + +    <option> +      <p><opt>publish-a-on-ipv6=</opt> Takes a boolean value +      ("yes" or "no"). If set to "yes" avahi-daemon will publish an +      IPv4 A record via IPv6, i.e. the local IPv4 addresses can be +      resolved using an IPv6 transport. Only useful when IPv6 is +      enabled with <opt>use-ipv6=true</opt>. Defaults to "no".</p> +    </option> + +  </section> + +  <section name="Section [reflector]"> +    <option> +      <p><opt>enable-reflector=</opt> Takes a boolean value ("yes" +      or "no"). If set to "yes" avahi-daemon will reflect incoming +      mDNS requests to all local network interfaces, effectively +      allowing clients to browse mDNS/DNS-SD services on all +      networks connected to the gateway. The gateway is somewhat +      intelligent and should work with all kinds of mDNS traffic, +      though some functionality is lost (specifically the unicast +      reply bit, which is used rarely anyway). Make sure to not run +      multiple reflectors between the same networks, this might +      cause them to play Ping Pong with mDNS packets. Defaults to +      "no".</p> +    </option> + +    <option> +      <p><opt>reflect-ipv=</opt> Takes a boolean value ("yes" or +      "no"). If set to "yes" and <opt>enable-reflector</opt> is +      enabled, avahi-daemon will forward mDNS traffic between IPv4 +      and IPv6, which is usually not recommended. Defaults to "no".</p> +    </option> +  </section> + +  <section name="Section [rlimits]"> +    <p>This section is used to define system resource limits for the +    daemon. See <manref section="2" name="setrlimit"/> for more +    information. If any of the options is not specified in the configuration +    file, avahi-daemon does not change it from the system +    defaults.</p> + +    <option> +      <p><opt>rlimit-as=</opt> Value in bytes for RLIMIT_AS (maximum size of the process's virtual memory). Sensible values are heavily system dependent.</p> +    </option> + +    <option> +      <p><opt>rlimit-core=</opt> Value in bytes for RLIMIT_CORE (maximum core file size). Unless you want to debug avahi-daemon, it is safe to set this to 0.</p> +    </option> + +    <option> +      <p><opt>rlimit-data=</opt> Value in bytes for RLIMIT_DATA (maximum size of the process's data segment). Sensible values are heavily system dependent.</p> +    </option> + +    <option> +      <p><opt>rlimit-fsize=</opt> Value for RLIMIT_FSIZE (maximum size of files the process may create). Since avahi-daemon shouldn't write any files to disk, it is safe to set this to 0.</p> +    </option> + +    <option> +      <p><opt>rlimit-nofile=</opt> Value for RLIMIT_NOFILE (open file descriptors). avahi-daemon shouldn't need more than 15 to 20 open file descriptors concurrently.</p> +    </option> + +    <option> +      <p><opt>rlimit-stack=</opt> Value in bytes for RLIMIT_STACK (maximum size of the process stack). Sensible values are heavily system dependent.</p> +    </option> + +    <option> +      <p><opt>rlimit-nproc=</opt> Value for RLIMIT_NPROC (number of process of user). avahi-daemon forks of a helper process on systems where <manref name="chroot" section="2"/> is available. Therefore this value should not be set below 2.</p> +    </option> + +  </section> + +  <section name="Authors"> +    <p>The Avahi Developers <@PACKAGE_BUGREPORT@>; Avahi is +    available from <url href="@PACKAGE_URL@"/></p> +  </section> + +  <section name="See also"> +    <p> +      <manref name="avahi-daemon" section="8"/>, <manref name="avahi-dnsconfd" section="8"/> +    </p> +  </section> + +  <section name="Comments"> +    <p>This man page was written using <manref name="xml2man" section="1" +    href="http://masqmail.cx/xml2man/"/> by Oliver Kurth.</p> +  </section> + +</manpage>  | 
