Date: Thu, 18 Apr 2013 17:39:15 +0400 From: "Andrey V. Elsukov" <bu7cher@yandex.ru> To: Sreenivasa Honnur <shonnur@chelsio.com> Cc: "freebsd-hackers@freebsd.org" <freebsd-hackers@freebsd.org> Subject: Re: PV6 bind fails with 49 (#define EADDRNOTAVAIL 49 /* Can't assign requested address */) Message-ID: <516FF783.1040609@yandex.ru> In-Reply-To: <F2BBBB6E0068844991318A316F34795C349141@nice.asicdesigners.com> References: <F2BBBB6E0068844991318A316F34795C349141@nice.asicdesigners.com>
next in thread | previous in thread | raw e-mail | index | archive | help
On 18.04.2013 15:37, Sreenivasa Honnur wrote: > I have a ipv6 interface(ping6 to a remove ipv6 works) when I try to > bind to this address through a socket program "sobind" fails with "49" > as return value. If I give "saddr6.sin6_addr = in6addr_any;" sobind > works. > > Any idea what could be going wrong here? > ifa_ifwithaddr_internal(struct sockaddr *addr, int getref) > { > ........ > ........ > > TAILQ_FOREACH(ifp, &V_ifnet, if_link) { > IF_ADDR_RLOCK(ifp); > printf("ifp->xname:%s ifp->dname:%s\n",ifp->if_xname, ifp->if_dname); > TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) { > if (ifa->ifa_addr->sa_family != addr->sa_family) ==> ifa->ifa_addr->sa_family=18 & addr->sa_family=28. Even though the interface is in IPV6 mode its sa_family is not set properly, > continue; > } This tailq contains any addresses assigned to the interface, sa_fimily=18 is for AF_LINK address, so it's ok. -- WBR, Andrey V. Elsukov
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?516FF783.1040609>