Subject: kern/16236: linux emulation for i386 requires INET6 for dns to work with suse7.3
To: None <gnats-bugs@gnats.netbsd.org>
From: Joachim Koenig-Baltes <joachim@joachim.handshake.de>
List: netbsd-bugs
Date: 04/07/2002 22:48:28
>Number:         16236
>Category:       kern
>Synopsis:       linux emul on i386 requires INET6 kernel option for dns
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sun Apr 07 13:47:00 PDT 2002
>Closed-Date:
>Last-Modified:
>Originator:     Joachim Koenig-Baltes
>Release:        NetBSD 1.5ZC
>Organization:
	
>Environment:
	
	
System: NetBSD joachim 1.5ZC NetBSD 1.5ZC (JOACHIM_ISDN) #3: Sun Apr 7 22:05:29 MEST 2002 joachim@joachim:/user/unix/work/NetBSD-current/src/sys/arch/i386/compile/JOACHIM_ISDN i386
Architecture: i386
Machine: i386
>Description:
on a freshly compiled kernel from sources from today, netscape communicator
4.79 from pkgsrc (with emulators/suse_linux updated to version 7.3) does not
resolve domain names, if kernel does _not_ have INET6 option enabled.
Similarly, 'ping', executed from a mounted Suse-7.3 files system does not
resolve host names via dns.
>How-To-Repeat:
mount a Suse 7.3 root filesystem to /mnt and execute
% ktruss /mnt/bin/ping www.focus.de
[...]
   313 ping     close(0x4)                         = 0
   313 ping     munmap(0x48065000, 0x2000)         = 0
   313 ping     "/emul/linux/etc/ld.so.cache"      = 4
   313 ping     fstat64(0x4, 0xbfbfceec)           = 0
   313 ping     old_mmap(0xbfbfceb4)               = 1208373248
   313 ping     close(0x4)                         = 0
   313 ping     "/emul/linux/lib/libnss_dns.so.2"  = 4
   313 ping     read(0x4, 0xbfbfd01c, 0x400)       = 1024

"\^?ELF\^A\^A\^A\0\0\0\0\0\0\0\0\0\^C\0\^C\0\^A\0\0\0`\^N\0\0004\0\0\0"
   313 ping     fstat64(0x4, 0xbfbfcf34)           = 0
   313 ping     old_mmap(0xbfbfce24)               = 1209729024
   313 ping     mprotect(0x481b3000, 0xda8, 0)     = 0
   313 ping     old_mmap(0xbfbfce24)               = 1209741312
   313 ping     close(0x4)                         = 0
   313 ping     munmap(0x48065000, 0x81ad)         = 0
   313 ping     socketcall(0x1, 0xbfbfc0c4)        = 4
   313 ping     socketcall(0x3, 0xbfbfc0c4)        Err#-22
   313 ping     close(0x4)                         = 0
   313 ping     socketcall(0x1, 0xbfbfc0c4)        = 4
   313 ping     socketcall(0x3, 0xbfbfc0c4)        Err#-22
   313 ping     close(0x4)                         = 0
   313 ping     socketcall(0x1, 0xbfbfc0c4)        = 4
ping: unknown host www.focus.de
   313 ping     socketcall(0x3, 0xbfbfc0c4)        Err#-22
   313 ping     close(0x4)                         = 0
   313 ping     socketcall(0x1, 0xbfbfc0c4)        = 4
   313 ping     socketcall(0x3, 0xbfbfc0c4)        Err#-22
   313 ping     close(0x4)                         = 0
   313 ping     write(0x2, 0xbfbfb1fc, 0x20)       = 32
       "ping: unknown host www.focus.de\n"
   313 ping     exit(0x2)
(dnsquery for www.focus.de works as expected, so the network configuration
is more or less o.k.)
the socketcall(0x3, ...) is the 'connect' call, which returns EINVAL. 
>Fix:
enable INET6 in your kernel config file and see it suddenly work. I do not
know, if it is the right fix or only a side effect as
syssrc/compat/linux/common/linux_socket.c contains some #ifdef INET6 in
linux_sa_get() where the arguments for connect() are copied, so I leave
this for the experts.
>Release-Note:
>Audit-Trail:
>Unformatted: