Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 26 Mar 2002 23:17:34 +0100
From:      Markus Stumpf <maex-lists-freebsd-net@Space.Net>
To:        freebsd-net@FreeBSD.ORG
Subject:   problems with udp46 sockets
Message-ID:  <20020326231734.H58573@Space.Net>

next in thread | raw e-mail | index | archive | help
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 <jinmei@isl.rdc.toshiba.co.jp>
    Subject: Re: nd6_rtrequest: bad gateway value: stf0
    Date: Sat, 23 Feb 2002 01:32:22 +0900
    Message-ID: <y7veljdbhpl.wl@condor.jinmei.org>
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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20020326231734.H58573>