Date: Sat, 19 May 2007 16:35:49 +0300 From: Stefan Lambrev <stefan.lambrev@sun-fish.com> To: "Bruce M. Simpson" <bms@incunabulum.net> Cc: freebsd-stable@freebsd.org Subject: Re: carp patch - will this ever be in releng_6? Message-ID: <464EFD35.703@sun-fish.com> In-Reply-To: <464EFB31.8010200@incunabulum.net> References: <464EF8F0.1090205@sun-fish.com> <464EFB31.8010200@incunabulum.net>
next in thread | previous in thread | raw e-mail | index | archive | help
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--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?464EFD35.703>