From owner-freebsd-net@FreeBSD.ORG Thu Apr 1 20:20:40 2010 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 30AD1106564A for ; Thu, 1 Apr 2010 20:20:40 +0000 (UTC) (envelope-from pieter@thedarkside.nl) Received: from mail.thelostparadise.com (aberdeen.thelostparadise.com [94.142.240.7]) by mx1.freebsd.org (Postfix) with ESMTP id EE1BE8FC18 for ; Thu, 1 Apr 2010 20:20:39 +0000 (UTC) Received: by mail.thelostparadise.com (Postfix, from userid 127) id 71D9973062; Thu, 1 Apr 2010 22:01:28 +0200 (CEST) Received: from localhost by mail.thelostparadise.com (Postfix) with ESMTP id 8D03273054 for ; Thu, 1 Apr 2010 22:01:27 +0200 (CEST) Message-ID: <4BB4FB93.8020108@thedarkside.nl> Date: Thu, 01 Apr 2010 22:01:23 +0200 From: Pieter de Boer MIME-Version: 1.0 To: freebsd-net@freebsd.org Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Subject: ::1 magically replaced with other address (2) X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Apr 2010 20:20:40 -0000 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? Thanks, Pieter