From owner-freebsd-stable@FreeBSD.ORG Fri Oct 13 12:14:10 2006 Return-Path: X-Original-To: freebsd-stable@freebsd.org Delivered-To: freebsd-stable@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id A419016A415 for ; Fri, 13 Oct 2006 12:14:10 +0000 (UTC) (envelope-from ari@suutari.iki.fi) Received: from espresso2.syncrontech.com (sync-old.syncrontech.com [213.28.98.35]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9264D43D86 for ; Fri, 13 Oct 2006 12:14:05 +0000 (GMT) (envelope-from ari@suutari.iki.fi) Received: from guinness.syncrontech.com (guinness.syncrontech.com [62.71.8.57]) by espresso2.syncrontech.com (8.13.1/8.13.1) with ESMTP id k9DCE3Wu049781; Fri, 13 Oct 2006 15:14:04 +0300 (EEST) (envelope-from ari@suutari.iki.fi) Received: from [127.0.0.1] (coffee.syncrontech.com [192.168.5.102]) by guinness.syncrontech.com (8.13.4/8.13.4) with ESMTP id k9DCE2MC013915; Fri, 13 Oct 2006 15:14:03 +0300 (EEST) (envelope-from ari@suutari.iki.fi) Message-ID: <452F82F6.4010902@suutari.iki.fi> Date: Fri, 13 Oct 2006 15:13:42 +0300 From: Ari Suutari User-Agent: Thunderbird 1.5.0.7 (Windows/20060909) MIME-Version: 1.0 To: Tom Judge References: <452E2151.80500@suutari.iki.fi> <452E27B4.2030709@tomjudge.com> <452E2AA0.4080702@suutari.iki.fi> <452F7BF2.5080206@suutari.iki.fi> <452F800A.9040408@tomjudge.com> In-Reply-To: <452F800A.9040408@tomjudge.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-stable@freebsd.org Subject: Re: carp0 interface goes down on 6.2-PRERELEASE X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 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, 13 Oct 2006 12:14:10 -0000 Hi, Tom Judge wrote: > Ari Suutari wrote: >> Ari Suutari wrote: >>> I have now tested with real hardware (ethernet is fxp0) and >>> under VmWare (ethernet is lnc0). Same problem on both. >> >> I'll have to correct this. Carp works with fxp0. Problem is >> only under vmware, which makes me more and more suspect >> that it is because lnc0 does not support link state reporting >> (it seems to be present on only a few drivers). >> > I do remember seeing this problem when developing some systems in vmware > that the carp interfaces where always in INIT when the system booted. I > added a small rc script to for the interfaces up using 'ifconfig carp0 > up' which seemed to make the interfaces come up however if on system is > unplugged from the network it will automatically put itself into the > master state until it can talk to the other servers in the carp group. > I already found the problem, it is in netinet/ip_carp.c. Since lnc driver doesn't support link state, the state is always LINK_STATE_UNKNOWN and carp code doesn't understand this. Following patch fixes it for me: cvs diff: Diffing . Index: ip_carp.c =================================================================== RCS file: /opt/freebsd-cvs/src/sys/netinet/ip_carp.c,v retrieving revision 1.27.2.8 diff -c -r1.27.2.8 ip_carp.c *** ip_carp.c 25 Sep 2006 13:01:59 -0000 1.27.2.8 --- ip_carp.c 13 Oct 2006 11:11:08 -0000 *************** *** 2116,2122 **** { CARP_SCLOCK_ASSERT(sc); ! if (sc->sc_carpdev->if_link_state != LINK_STATE_UP || !(sc->sc_carpdev->if_flags & IFF_UP)) { sc->sc_flags_backup = SC2IFP(sc)->if_flags; SC2IFP(sc)->if_flags &= ~IFF_UP; --- 2116,2122 ---- { CARP_SCLOCK_ASSERT(sc); ! if (sc->sc_carpdev->if_link_state == LINK_STATE_DOWN || !(sc->sc_carpdev->if_flags & IFF_UP)) { sc->sc_flags_backup = SC2IFP(sc)->if_flags; SC2IFP(sc)->if_flags &= ~IFF_UP; Ari S.