From owner-freebsd-net Tue Mar 26 14:17:40 2002 Delivered-To: freebsd-net@freebsd.org Received: from moebius2.Space.Net (moebius2.Space.Net [195.30.1.100]) by hub.freebsd.org (Postfix) with SMTP id 3FCFF37B416 for ; Tue, 26 Mar 2002 14:17:36 -0800 (PST) Received: (qmail 79391 invoked by uid 1013); 26 Mar 2002 22:17:34 -0000 Date: Tue, 26 Mar 2002 23:17:34 +0100 From: Markus Stumpf To: freebsd-net@FreeBSD.ORG Subject: problems with udp46 sockets Message-ID: <20020326231734.H58573@Space.Net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i Organization: SpaceNet AG, Muenchen, Germany X-PGP-Fingerprint: 66 F3 75 79 01 D0 B8 5F 1A C7 77 88 4A B6 70 DF Sender: owner-freebsd-net@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org I am trying to get dnscache running with IPv6 patches. dnscache binds to the IPv6 unqualified address "::". This works fine and I get (from netstat) udp46 0 0 *.53 *.* As the sending address the IPv6 unqualified address "::" is used, also. As long as I only send queries via either IPv6 or IPv4 all works well, but all subsequent queries via IPv6 after one or more queries via IPv4 fail. The queries arrive properly, but sending the answer fails. From truss I can see for that IPv6 answers: sendto(0x3,0x80f34e0,0x55,0x0,0xbfbffbd0,0x1c) ERR#65 'No route to host' for all queries via IPv6, queries via IPv4 still work without problems. It doesn't matter if I use different source hosts for the queries via IPv6, it fails for all of them. The code sending the answers is: int socket_send6(int s,const char *buf,unsigned int len,const char ip[16],uint16 port,uint32 scope_id) { struct sockaddr_in6 sa; byte_zero(&sa,sizeof sa); sa.sin6_family = AF_INET6; if (scope_id) uint32_pack_big((char *)&sa.sin6_scope_id, scope_id); uint16_pack_big((char *) &sa.sin6_port,port); byte_copy((char *) &sa.sin6_addr,16,ip); return sendto(s,buf,len,0,(struct sockaddr *) &sa,sizeof sa); } I have checked with debug output and the port and dest ip address are correctly filled in. What really puzzles me is that answers via IPv4 seem to cause some kind of confusion so that subsequent IPv6 packets have the "no route to host" error, but answers via IPv4 still work. Also there is no problem to ping6 the hosts from each other. I am running FreeBSD 4.5-RELEASE GENERIC kernel. I have also applied the patch from this list http://docs.freebsd.org/cgi/getmsg.cgi?fetch=345287+0+archive/2002/freebsd-net/20020224.freebsd-net From: JINMEI Tatuya / ?$B?@L@C#:H?(B Subject: Re: nd6_rtrequest: bad gateway value: stf0 Date: Sat, 23 Feb 2002 01:32:22 +0900 Message-ID: and built a new kernel, but that didn't fix the problem (thought it could be related). Could it be that the problem JINMEI Tatuya fixed in http://www.FreeBSD.org/cgi/getmsg.cgi?fetch=100979+0+/usr/local/www/db/text/2002/freebsd-hackers/20020303.freebsd-hackers for TCP also applies to UDP (and has to be fixed there?) Any ideas? If you need more information, I'll be happy to provide it. Thanks, \Maex To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-net" in the body of the message