[Pkg-utopia-maintainers] Bug#610281: avahi-daemon uses a wrong flag combination to operate with rtnetlink

Arthur Marsh arthur.marsh at internode.on.net
Mon Jan 17 00:51:00 UTC 2011


Package: avahi-daemon
Version: 0.6.27-3
Severity: normal


Pablo Neira Ayuso (pablo at netfilter.org) reported:

Please, pass this patch to the avahi-daemon developers. They use an
invalid netlink flag combination for dump operations.

This patch has spotted a problem that they have to fix indeed.
[end quote]

patch attached

-- System Information:
Debian Release: 6.0
  APT prefers unstable
  APT policy: (500, 'unstable'), (500, 'testing'), (500, 'stable'), (1, 'experimental')
Architecture: i386 (i686)

Kernel: Linux 2.6.37+ (SMP w/1 CPU core)
Locale: LANG=en_AU.UTF-8, LC_CTYPE=en_AU.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash

Versions of packages avahi-daemon depends on:
ii  adduser              3.112+nmu2          add and remove users and groups
ii  bind9-host [host]    1:9.7.2.dfsg.P3-1.1 Version of 'host' bundled with BIN
ii  dbus                 1.2.24-4            simple interprocess messaging syst
ii  libavahi-common3     0.6.27-3            Avahi common library
ii  libavahi-core7       0.6.27-3            Avahi's embeddable mDNS/DNS-SD lib
ii  libc6                2.11.2-8            Embedded GNU C Library: Shared lib
ii  libcap2              1:2.19-3            support for getting/setting POSIX.
ii  libdaemon0           0.14-2              lightweight C library for daemons 
ii  libdbus-1-3          1.2.24-4            simple interprocess messaging syst
ii  libexpat1            2.0.1-7             XML parsing C library - runtime li
ii  lsb-base             3.2-26              Linux Standard Base 3.2 init scrip

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

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

-- debconf-show failed
-------------- next part --------------
avahi: fix wrong use of netlink flags for dump operations

The avahi-daemon uses a wrong flag combination to operate with
rtnetlink. This patch fixes the problems.

No need to set NLM_F_ACK since the dump operation already includes
the trailing NLMSG_DONE message that informs about the end of the
dump operation.

Please, consider porting the avahi-daemon to libmnl:

http://www.netfilter.org/projects/libmnl/index.html

Signed-off-by: Pablo Neira Ayuso <pablo at netfilter.org>

Index: avahi-0.6.27/avahi-autoipd/iface-linux.c
===================================================================
--- avahi-0.6.27.orig/avahi-autoipd/iface-linux.c	2011-01-16 22:06:20.000000000 +0100
+++ avahi-0.6.27/avahi-autoipd/iface-linux.c	2011-01-16 22:07:34.000000000 +0100
@@ -262,7 +262,7 @@ int iface_get_initial_state(State *state
     n->nlmsg_len = NLMSG_LENGTH(sizeof(*ifi));
     n->nlmsg_type = RTM_GETLINK;
     n->nlmsg_seq = seq;
-    n->nlmsg_flags = NLM_F_MATCH|NLM_F_REQUEST|NLM_F_ACK;
+    n->nlmsg_flags = NLM_F_REQUEST|NLM_F_DUMP;
     n->nlmsg_pid = 0;
 
     ifi = NLMSG_DATA(n);
Index: avahi-0.6.27/avahi-core/iface-linux.c
===================================================================
--- avahi-0.6.27.orig/avahi-core/iface-linux.c	2011-01-16 22:06:51.000000000 +0100
+++ avahi-0.6.27/avahi-core/iface-linux.c	2011-01-16 22:07:08.000000000 +0100
@@ -53,7 +53,7 @@ static int netlink_list_items(AvahiNetli
     n = (struct nlmsghdr*) req;
     n->nlmsg_len = NLMSG_LENGTH(sizeof(struct rtgenmsg));
     n->nlmsg_type = type;
-    n->nlmsg_flags = NLM_F_ROOT|NLM_F_REQUEST;
+    n->nlmsg_flags = NLM_F_REQUEST|NLM_F_DUMP;
     n->nlmsg_pid = 0;
 
     gen = NLMSG_DATA(n);


More information about the Pkg-utopia-maintainers mailing list