From owner-freebsd-bugs@FreeBSD.ORG Fri Oct 6 03:59:44 2006 Return-Path: X-Original-To: freebsd-bugs@FreeBSD.org Delivered-To: freebsd-bugs@FreeBSD.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 1036216A416 for ; Fri, 6 Oct 2006 03:59:44 +0000 (UTC) (envelope-from suz@alaxala.net) Received: from pc1.alaxala.net (pc1.alaxala.net [203.178.142.162]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5700843D5F for ; Fri, 6 Oct 2006 03:59:40 +0000 (GMT) (envelope-from suz@alaxala.net) Received: from localhost (localhost [127.0.0.1]) by pc1.alaxala.net (Postfix) with ESMTP id C3EC1BA79; Fri, 6 Oct 2006 12:59:39 +0900 (JST) X-Virus-Scanned: amavisd-new at alaxala.net Received: from pc1.alaxala.net ([127.0.0.1]) by localhost (pc1.alaxala.net [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id rDAwbJ-0bL10; Fri, 6 Oct 2006 12:59:35 +0900 (JST) Received: from flora220.uki-uki.net (pc2.alaxala.net [203.178.142.163]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by pc1.alaxala.net (Postfix) with ESMTP id E2F03B9DA; Fri, 6 Oct 2006 12:59:34 +0900 (JST) Date: Fri, 06 Oct 2006 12:59:32 +0900 Message-ID: From: SUZUKI Shinsuke To: gavin.atkinson@ury.york.ac.uk X-cite: xcite 1.33 In-Reply-To: <200607271610.k6RGANiw051260@freefall.freebsd.org> References: <200607271610.k6RGANiw051260@freefall.freebsd.org> User-Agent: Wanderlust/2.15.1 (Almost Unreal) Emacs/22.0 Mule/5.0 (SAKAKI) Organization: Networking Technology Development Dept., ALAXALA Networks Corporation MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII Cc: freebsd-bugs@FreeBSD.org Subject: Re: kern/98622: [carp] carp with IPv6 broken on 6.1 (regression) X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Oct 2006 03:59:44 -0000 Hi Gavin, >>>>> On Thu, 27 Jul 2006 16:10:23 GMT >>>>> gavin.atkinson@ury.york.ac.uk(Gavin Atkinson) said: > I can confirm this worked in 6.0-R and is broken in 6.1-R, and I can > confirm it was the commit by ume@freebsd.org mentioned in the past log > entries of this PR that broke it: > http://docs.FreeBSD.org/cgi/mid.cgi?200511042026.jA4KQGX9038319 > > In my case, I don't see the backup constantly switching, instead I see > both the master and backup constantly acting as master, but only on the > IPv6 interface - the IPv4 interface works as expected. This difference > could be due to te fact that I have the IPv4 interface on this machine > also under carp's control, although I do have sysctl > net.inet.carp.preempt=1, which in theory should mean that all interfaces > track each other's state. Could you please try the attached patch (this is for RELENG_6, but the same patch would probably work for -CURRENT)? I can reproduce the phenomena and it seems like my patch fixes it. Here's my analysis: The destination address (ff02::12) of IPv6 CARP packet does not contain a scope information. In such case, IPv6 stack does now allow the advertisement of CARP packet, because of an inconsistent scope boundary information, which was introduced in the patch you mentioned above. (i.e. the destination address must have a link-local scope, but there is no scope information at all) Index: ip_carp.c =================================================================== RCS file: /home/ncvs/src/sys/netinet/ip_carp.c,v retrieving revision 1.27.2.8 diff -u -p -r1.27.2.8 ip_carp.c --- ip_carp.c 25 Sep 2006 13:01:59 -0000 1.27.2.8 +++ ip_carp.c 6 Oct 2006 03:52:03 -0000 @@ -968,6 +968,7 @@ carp_send_ad_locked(struct carp_softc *s ip6->ip6_dst.s6_addr8[0] = 0xff; ip6->ip6_dst.s6_addr8[1] = 0x02; ip6->ip6_dst.s6_addr8[15] = 0x12; + in6_setscope(&ip6->ip6_dst, sc->sc_ia6->ia_ifp, NULL); ch_ptr = (struct carp_header *)(&ip6[1]); bcopy(&ch, ch_ptr, sizeof(ch));