Package: libnss-mdns
Version: 0.9-0.1
Severity: important
I discovered that calls to 'getaddrinfo' were taking a long time.
I had previous worked around a misfeature in getaddrinfo to avoid using
IPv6 addresses. However, this problem appears to derive from libnss_mdns4;
for some reason it appears to be asking the avahi-daemon about an address that
is
already resolved. Here is an excerpt from strace:
open("/usr/lib/libnss_mdns4.so.2", O_RDONLY) = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0P\t\0\000"..., 512) =
512
fstat64(3, {st_mode=S_IFREG|0644, st_size=7208, ...}) = 0
mmap2(NULL, 10164, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) =
0xb7e1f000
mmap2(0xb7e21000, 4096, PROT_READ|PROT_WRITE,
MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x1) = 0xb7e21000
close(3) = 0
socket(PF_FILE, SOCK_STREAM, 0) = 3
fcntl64(3, F_GETFD) = 0
fcntl64(3, F_SETFD, FD_CLOEXEC) = 0
connect(3, {sa_family=AF_FILE, path="/var/run/avahi-daemon/socket"}, 110) = 0
fcntl64(3, F_GETFL) = 0x2 (flags O_RDWR)
fstat64(3, {st_mode=S_IFSOCK|0777, st_size=0, ...}) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) =
0xb7e1e000
_llseek(3, 0, 0xbfedc6ac, SEEK_CUR) = -1 ESPIPE (Illegal seek)
write(3, "RESOLVE-ADDRESS 140.247.60.247\n", 31) = 31
read(3, "-15 Timeout reached\n", 1024) = 20
close(3) = 0
This timeout costs 5 seconds per address lookup and is quite annoying.
It just seems wrong to ask Avahi to resolve an address that is already
in dotted-decimal form.
The source program being run is
#include <netdb.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
main (int argc, char **argv) {
if (argc == 3) {
int rc;
struct addrinfo *res;
struct addrinfo hints;
memset(&hints, 0, sizeof(hints));
hints.ai_socktype = SOCK_STREAM;
hints.ai_flags = AI_CANONNAME;
hints.ai_family = AF_INET; /* added to avoid IPv6 distractions */
rc = getaddrinfo(argv[1], argv[2], &hints, &res);
printf("getaddrinfo returns %d\n", rc);
} else {
fprintf(stderr, "Usage: %s hostname port\n", argv[0]);
return 1;
}
}
And for reasons I can't fathom at all, I can only seem to duplicate
the problem when querying machines in my own domain.
I hope you can help.
-- System Information:
Debian Release: 4.0
APT prefers testing
APT policy: (500, 'testing'), (500, 'stable'), (50, 'unstable')
Architecture: i386 (i686)
Shell: /bin/sh linked to /bin/bash
Kernel: Linux 2.6.18-3-k7
Locale: LANG=C, LC_CTYPE=C (charmap=ANSI_X3.4-1968)
Versions of packages libnss-mdns depends on:
ii avahi-daemon 0.6.16-2 Avahi mDNS/DNS-SD daemon
ii base-files 4 Debian base system miscellaneous f
ii libc6 2.3.6.ds1-11 GNU C Library: Shared libraries
ii perl 5.8.8-7 Larry Wall's Practical Extraction
libnss-mdns recommends no packages.
-- no debconf information
--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]