Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 7 Apr 2016 21:13:55 +0200
From:      Kristof Provost <kp@FreeBSD.org>
To:        "Andrey V. Elsukov" <ae@FreeBSD.org>
Cc:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   Re: svn commit: r296986 - head/sys/netinet6
Message-ID:  <87DA8A8F-3CD6-46A6-B4ED-BC31ADDADABC@FreeBSD.org>
In-Reply-To: <201603171110.u2HBAiFR075164@repo.freebsd.org>
References:  <201603171110.u2HBAiFR075164@repo.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help

> On 17 Mar 2016, at 12:10, Andrey V. Elsukov <ae@FreeBSD.org> wrote:
>=20
> Author: ae
> Date: Thu Mar 17 11:10:44 2016
> New Revision: 296986
> URL: https://svnweb.freebsd.org/changeset/base/296986
>=20
> Log:
>  Reduce the number of local variables. Remove redundant check that inp
>  pointer isn't NULL, it is safe, because we are handling IPV6_PKTINFO
>  socket option in this block of code. Also, use in6ifa_withaddr() =
instead
>  of ifa_withaddr().
...
>  in6_selectsrc(uint32_t fibnum, struct so
> 		 * the interface must be specified; otherwise, =
ifa_ifwithaddr()
> 		 * will fail matching the address.
> 		 */
> -		bzero(&srcsock, sizeof(srcsock));
> -		srcsock.sin6_family =3D AF_INET6;
> -		srcsock.sin6_len =3D sizeof(srcsock);
> -		srcsock.sin6_addr =3D pi->ipi6_addr;
> +		tmp =3D pi->ipi6_addr;
> 		if (ifp) {
> -			error =3D in6_setscope(&srcsock.sin6_addr, ifp, =
NULL);
> +			error =3D in6_setscope(&tmp, ifp, &odstzone);
> 			if (error)
> 				return (error);
> 		}
> 		if (cred !=3D NULL && (error =3D prison_local_ip6(cred,
> -		    &srcsock.sin6_addr, (inp !=3D NULL &&
> -		    (inp->inp_flags & IN6P_IPV6_V6ONLY) !=3D 0))) !=3D =
0)
> +		    &tmp, (inp->inp_flags & IN6P_IPV6_V6ONLY) !=3D 0)) =
!=3D 0)
> 			return (error);
>=20
> 		/*
> @@ -262,19 +255,18 @@ in6_selectsrc(uint32_t fibnum, struct so
> 		 * ancillary data.
> 		 */
> 		if ((inp->inp_flags & INP_BINDANY) =3D=3D 0) {
> -			ia6 =3D (struct in6_ifaddr *)ifa_ifwithaddr(
> -			    (struct sockaddr *)&srcsock);
> -			if (ia6 =3D=3D NULL || (ia6->ia6_flags & =
(IN6_IFF_ANYCAST |
> +			ia =3D in6ifa_ifwithaddr(&tmp, odstzone);

I believe this breaks radvd. It tries to send out RAs with a link-local =
source address.
These fail with 'ERR#49 'Can't assign requested address=E2=80=99=E2=80=99.=


Note that =E2=80=98tmp=E2=80=99 has had the zoneid embedded into it =
already (in6_setscope() above), so the address comparison in =
in6ifa_ifwithaddr() fails to match.
That leads to the EADDRNOTAVAIL error.

I don=E2=80=99t think this is the specific commit that broke things (at =
least, I don=E2=80=99t see how it worked before),
but I=E2=80=99m hoping you=E2=80=99ll have a better idea of what went =
wrong.

Regards,
Kristof=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?87DA8A8F-3CD6-46A6-B4ED-BC31ADDADABC>