From owner-freebsd-stable@FreeBSD.ORG Sat May 19 13:35:52 2007 Return-Path: X-Original-To: freebsd-stable@freebsd.org Delivered-To: freebsd-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 37B2616A404 for ; Sat, 19 May 2007 13:35:52 +0000 (UTC) (envelope-from stefan.lambrev@sun-fish.com) Received: from blah.sun-fish.com (blah.sun-fish.com [217.18.249.150]) by mx1.freebsd.org (Postfix) with ESMTP id B3EC113C45E for ; Sat, 19 May 2007 13:35:51 +0000 (UTC) (envelope-from stefan.lambrev@sun-fish.com) Received: from blah.sun-fish.com (localhost [127.0.0.1]) by blah.sun-fish.com (Postfix) with ESMTP id E250C1B10EA4; Sat, 19 May 2007 15:35:49 +0200 (CEST) Received: from hater.cmotd.com (hater.cmotd.com [192.168.3.125]) by blah.sun-fish.com (Postfix) with ESMTP id D79971B10C26; Sat, 19 May 2007 15:35:49 +0200 (CEST) Message-ID: <464EFD35.703@sun-fish.com> Date: Sat, 19 May 2007 16:35:49 +0300 From: Stefan Lambrev User-Agent: Thunderbird 2.0.0.0 (X11/20070425) MIME-Version: 1.0 To: "Bruce M. Simpson" References: <464EF8F0.1090205@sun-fish.com> <464EFB31.8010200@incunabulum.net> In-Reply-To: <464EFB31.8010200@incunabulum.net> Content-Type: multipart/mixed; boundary="------------090606080405020307030505" X-Virus-Scanned: ClamAV using ClamSMTP on BLAH Cc: freebsd-stable@freebsd.org Subject: Re: carp patch - will this ever be in releng_6? 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: Sat, 19 May 2007 13:35:52 -0000 This is a multi-part message in MIME format. --------------090606080405020307030505 Content-Type: text/plain; charset=windows-1251; format=flowed Content-Transfer-Encoding: 7bit Hi, Bruce M. Simpson wrote: > Stefan Lambrev wrote: >> >> Are there any chances for this: >> http://www.freebsd.org/cgi/cvsweb.cgi/src/sys/netinet/ip_carp.c.diff?r1=1.46;r2=1.47 >> >> to be MFCed to RELENG_6 before 6.3-release ? >> >> It fixes quite annoying bug - destroying carpX (when having at least >> 2 carp interfaces) will panic immediately. >> This bugfix is from 3+ months ago. >> > Sadly it is unlikely the failure condition you describe will be fixed > in -STABLE, as resolving it requires far more work to be merged than > the link to the diff you post above. The attached patch worked for me - it is based on the posted URL. At least I didn't notice bad effects and it fixes the bug. -- Best Wishes, Stefan Lambrev ICQ# 24134177 --------------090606080405020307030505 Content-Type: text/plain; name="carp.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="carp.patch" --- src/sys/netinet/ip_carp.c.orig Thu Feb 1 18:53:55 2007 +++ src/sys/netinet/ip_carp.c Tue Feb 6 18:41:24 2007 @@ -191,7 +191,7 @@ static void carp_input_c(struct mbuf *, struct carp_header *, sa_family_t); static int carp_clone_create(struct if_clone *, int); static void carp_clone_destroy(struct ifnet *); -static void carpdetach(struct carp_softc *); +static void carpdetach(struct carp_softc *, int); static int carp_prepare_ad(struct mbuf *, struct carp_softc *, struct carp_header *); static void carp_send_ad_all(void); @@ -406,9 +406,7 @@ if (sc->sc_carpdev) CARP_SCLOCK(sc); - carpdetach(sc); - if (sc->sc_carpdev) - CARP_SCUNLOCK(sc); + carpdetach(sc, 1); /* Returns unlocked. */ mtx_lock(&carp_mtx); LIST_REMOVE(sc, sc_next); @@ -420,7 +418,7 @@ } static void -carpdetach(struct carp_softc *sc) +carpdetach(struct carp_softc *sc, int unlock) { struct carp_if *cif; @@ -450,9 +448,10 @@ sc->sc_carpdev->if_carp = NULL; CARP_LOCK_DESTROY(cif); FREE(cif, M_IFADDR); - } + } else if (unlock) + CARP_UNLOCK(cif); + sc->sc_carpdev = NULL; } - sc->sc_carpdev = NULL; } /* Detach an interface from the carp. */ @@ -471,7 +470,7 @@ CARP_LOCK(cif); for (sc = TAILQ_FIRST(&cif->vhif_vrs); sc; sc = nextsc) { nextsc = TAILQ_NEXT(sc, sc_list); - carpdetach(sc); + carpdetach(sc, 0); } } --------------090606080405020307030505--