::1 magically replaced with other address (2)
Bjoern A. Zeeb
bzeeb-lists at lists.zabbadoz.net
Fri Apr 2 09:25:08 UTC 2010
On Thu, 1 Apr 2010, Pieter de Boer wrote:
> Hi folks,
>
> A couple of days ago I sent a mail to this list detailing an issue I have. To
> summarize: every once in a while my ::1 address on lo0 is replaced with
> another ipv6-address that's configured on lo3 and used in a child jail of a
> jail. I've been digging a bit through the FreeBSD source code and found a
> possible spot where this may occur.
>
> In the function in6_selectsrc() in /sys/netinet6/in6_src.c the following code
> can be found:
>
>
> TAILQ_FOREACH(ia, &V_in6_ifaddrhead, ia_link) {
> ...
>
> prison_local_ip6(cred, &ia->ia_addr.sin6_addr,
> (inp != NULL &&
> (inp->inp_flags & IN6P_IPV6_V6ONLY) != 0)) != 0)
> continue;
> ...
> }
>
> prison_local_ip6() appears to replace a loopback address with a jail's main
> address:
> if (IN6_IS_ADDR_LOOPBACK(ia6)) {
> bcopy(&pr->pr_ip6[0], ia6, sizeof(struct in6_addr));
> ...
>
>
> The way I read this code is that it replaces the interface address 'ia' when
> it is a loopback address with the prison's main address.
>
> Can anyone with more clue about this code tell if I read this correctly and
> possibly even help with fixing the problem if that is the case?
You are reading this correctly. Good catch! I'll look how to fix that.
/bz
--
Bjoern A. Zeeb It will not break if you know what you are doing.
More information about the freebsd-net
mailing list