Re: ifconfig carp0 destroy = kernel panic

From: Ed Schouten <ed_at_fxq.nl>
Date: Sun, 3 Jun 2007 16:47:32 +0200
Gleb,

* Gleb Smirnoff <glebius_at_FreeBSD.org> wrote:
> Please confirm, that this patch fixes your problem:
> 
> http://www.freebsd.org/cgi/cvsweb.cgi/src/sys/netinet/ip_carp.c.diff?r1=text&tr1=1.45&r2=text&tr2=1.47
> 
> I will merge it to RELENG_6.

Please take a look at this patch as well. It has been lying around in
GNATS for some time and it really makes me go insane a lot of times:

%%%
--- src/sys/netinet/ip_carp.c	Sat Jan 20 00:01:33 2007
+++ src/sys/netinet/ip_carp.c	Sun Feb 18 23:13:01 2007
_at__at_ -1882,8 +1882,10 _at__at_
 				cif = (struct carp_if *)sc->sc_carpdev->if_carp;
 				TAILQ_FOREACH(vr, &cif->vhif_vrs, sc_list)
 					if (vr != sc &&
-					    vr->sc_vhid == carpr.carpr_vhid)
-						return EEXIST;
+					    vr->sc_vhid == carpr.carpr_vhid) {
+						error = EEXIST;
+						goto out;
+					}
 			}
 			sc->sc_vhid = carpr.carpr_vhid;
 			IFP2ENADDR(sc->sc_ifp)[0] = 0;
_at__at_ -1933,6 +1935,7 _at__at_
 		error = EINVAL;
 	}
 
+out:
 	if (locked)
 		CARP_SCUNLOCK(sc);
 
%%%

Just assign the same VHID to two CARP interfaces and your box panics
because it forgets to unlock the CARP device. See also:

	http://www.freebsd.org/cgi/query-pr.cgi?pr=kern/92776

Yours,
-- 
 Ed Schouten <ed_at_fxq.nl>
 WWW: http://g-rave.nl/

Received on Sun Jun 03 2007 - 12:47:34 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:39:11 UTC