Package: avahi-daemon
Version: 0.6.23-3lenny1
Severity: wishlist
Tags: patch


For lans with a lot of mDNS/DNS-SD services running, avahi seems to be
unable to keep track of all of them, and avahi-browse starts throwing
errors like:

> Failed to resolve service 'pu...@alanine' of type '_pulse-server._tcp' in 
> domain 'local': Too many objects
> Failed to resolve service 'pu...@leucine' of type '_pulse-server._tcp' in 
> domain 'local': Too many objects
> Failed to resolve service 'pu...@unagipie' of type '_pulse-server._tcp' in 
> domain 'local': Too many objects
> Failed to resolve service 'pu...@tupaia' of type '_pulse-server._tcp' in 
> domain 'local': Too many objects
> Failed to resolve service 'pu...@lime' of type '_pulse-server._tcp' in domain 
> 'local': Too many objects
> Failed to resolve service 'pu...@gallus' of type '_pulse-server._tcp' in 
> domain 'local': Too many objects

This seems to have been discussed in detail here:
http://www.mail-archive.com/av...@lists.freedesktop.org/msg01487.html
and the solution the guy in the linked message solution suggests:

> Original Parameters:
> 
> AVAHI_CACHE_ENTRIES_MAX = 500
> OBJECTS_PER_CLIENT_MAX = 500
> 
> Changed Parameters:
> 
> AVAHI_CACHE_ENTRIES_MAX = 6000
> OBJECTS_PER_CLIENT_MAX = 4000

Seems to work perfectly, without any bad side effects (I suppose
avahi-daemon's probably taking more ram than it used to, but this
hardly seems excessive or risking DOS). I realize it's a judgement
call perhaps best left to the upstream avahi guys, but a /24 subnet
can go over their predefined limits pretty easily, and lacking runtime
parameters to set this, it seems that this limit should probably be
higher. For example only half of our 150-ish IPs use avahi, and yet we
seem to have gone over their limit.

For reference I've attached a patch that makes the changes described
in that listserv post.

-- System Information:
Debian Release: 5.0.3
  APT prefers stable
  APT policy: (800, 'stable'), (600, 'testing')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.30-2-amd64 (SMP w/2 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash

Versions of packages avahi-daemon depends on:
ii  adduser                3.110             add and remove users and groups
ii  bind9-host [host]      1:9.5.1.dfsg.P3-1 Version of 'host' bundled with BIN
ii  dbus                   1.2.1-5           simple interprocess messaging syst
ii  libavahi-common3       0.6.23-3lenny1    Avahi common library
ii  libavahi-core5         0.6.23-3lenny1    Avahi's embeddable mDNS/DNS-SD lib
ii  libc6                  2.9-25            GNU C Library: Shared libraries
ii  libcap2                2.11-2            support for getting/setting POSIX.
ii  libdaemon0             0.14-1            lightweight C library for daemons 
ii  libdbus-1-3            1.2.1-5           simple interprocess messaging syst
ii  libexpat1              2.0.1-4           XML parsing C library - runtime li
ii  lsb-base               3.2-20            Linux Standard Base 3.2 init scrip

Versions of packages avahi-daemon recommends:
ii  libnss-mdns                   0.10-3     NSS module for Multicast DNS name 

Versions of packages avahi-daemon suggests:
pn  avahi-autoipd                 <none>     (no description available)

-- no debconf information
diff -rupN avahi-0.6.23/avahi-core/cache.c avahi-0.6.23.bigcache/avahi-core/cache.c
--- avahi-0.6.23/avahi-core/cache.c	2008-06-18 08:13:44.000000000 +0900
+++ avahi-0.6.23.bigcache/avahi-core/cache.c	2009-11-25 19:43:07.652599500 +0900
@@ -34,7 +34,7 @@
 #include "log.h"
 #include "rr-util.h"
 
-#define AVAHI_CACHE_ENTRIES_MAX 500
+#define AVAHI_CACHE_ENTRIES_MAX 6000
 
 static void remove_entry(AvahiCache *c, AvahiCacheEntry *e) {
     AvahiCacheEntry *t;
diff -rupN avahi-0.6.23/avahi-daemon/dbus-internal.h avahi-0.6.23.bigcache/avahi-daemon/dbus-internal.h
--- avahi-0.6.23/avahi-daemon/dbus-internal.h	2008-06-18 08:13:44.000000000 +0900
+++ avahi-0.6.23.bigcache/avahi-daemon/dbus-internal.h	2009-11-25 19:42:35.493628824 +0900
@@ -46,7 +46,7 @@ typedef struct AsyncServiceResolverInfo 
 typedef struct RecordBrowserInfo RecordBrowserInfo;
 
 #define CLIENTS_MAX 256
-#define OBJECTS_PER_CLIENT_MAX 250
+#define OBJECTS_PER_CLIENT_MAX 4000
 #define ENTRIES_PER_ENTRY_GROUP_MAX 20
 
 struct EntryGroupInfo {

Reply via email to