From owner-freebsd-stable@freebsd.org Fri Aug 21 07:07:06 2015 Return-Path: Delivered-To: freebsd-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2E2CC9BD698 for ; Fri, 21 Aug 2015 07:07:06 +0000 (UTC) (envelope-from emz@norma.perm.ru) Received: from elf.hq.norma.perm.ru (unknown [IPv6:2a00:7540:1::5]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mail.norma.perm.ru", Issuer "Vivat-Trade UNIX Root CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 8055F1B1D for ; Fri, 21 Aug 2015 07:07:04 +0000 (UTC) (envelope-from emz@norma.perm.ru) Received: from bsdrookie.norma.com. (perederenko.norma.com [IPv6:fd00::7dd] (may be forged)) by elf.hq.norma.perm.ru (8.14.9/8.14.9) with ESMTP id t7L76s9k027172 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO) for ; Fri, 21 Aug 2015 12:06:54 +0500 (YEKT) (envelope-from emz@norma.perm.ru) Subject: Re: [POSSIBLE BUG] 10-STABLE CARP erroneously becomes master on boot To: freebsd-stable@freebsd.org References: From: "Eugene M. Zheganin" X-Enigmail-Draft-Status: N1110 Message-ID: <55D6CE0D.9030806@norma.perm.ru> Date: Fri, 21 Aug 2015 12:06:53 +0500 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:38.0) Gecko/20100101 Thunderbird/38.1.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.4.3 (elf.hq.norma.perm.ru [IPv6:fd00::30a]); Fri, 21 Aug 2015 12:06:54 +0500 (YEKT) X-Spam-Status: No hits=-100.2 bayes=0.0000 testhits AWL=0.250,BAYES_00=-1.9, RDNS_NONE=0.793,SPF_SOFTFAIL=0.665,USER_IN_WHITELIST=-100 autolearn=no autolearn_force=no version=3.4.0 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on elf.hq.norma.perm.ru X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Aug 2015 07:07:06 -0000 Hi. On 20.08.2015 14:51, Damien Fleuriot wrote: > > Hello list, > > > > We've managed to find the source of the bug, if it is indeed a bug. > > It all comes down to the order in which the IP addresses are assigned to > the interface from /etc/rc.conf. > > > When using the following syntax, the physical IP address is configured > AFTER the CARPs on the interface, which results in the CARP advertisements > being sourced from the CARP IP, triggering the double MASTER situation : > ipv4_addrs_int="1.2.3.4/24" > ifconfig_int_alias0="1.2.3.6/32 vhid 1 pass test advskew 20" > > When using either of the following syntaxes, the physical IP address is > configured BEFORE the CARPs, which results in the CARP advertisements being > sourced from the physical IP and restoring normal functionality : > ifconfig_int="inet 1.2.3.4/24" > ifconfig_int_alias0="1.2.3.6/32 vhid 1 pass test advskew 20" > OR > ifconfig_int_alias0="1.2.3.4/24" > ifconfig_int_alias1="1.2.3.6/32 vhid 1 pass test advskew 20" > It has been there since carp-ng was commited to the 10-CURRENT 2 years ago. The thing is, carp-ng doesn't need a non-carp address on an interface anymore, both nodes can work fine using only shared address. This isn't comfortable in lots of cases, but still. Thus, kernel sends carp advertisements from a primary address on the interface (which is normal behavior for any known network stack) and for FreeBSD that primary address has always been the first address on an interface for a given AF. Thus, your split-brain carp situation cause lies definitely somewhere else. I'm running carp on FreeBSD for years, including legacy one; if there is a bug - the situation you are describing probably isn't one. Eugene.