svn commit: r196398 - in stable/8/sys: . amd64/include/xen cddl/contrib/opensolaris contrib/dev/acpica contrib/pf dev/xen/xenpci netinet

Will Andrews will at FreeBSD.org
Thu Aug 20 02:49:43 UTC 2009


Author: will
Date: Thu Aug 20 02:49:43 2009
New Revision: 196398
URL: http://svn.freebsd.org/changeset/base/196398

Log:
  MFC r196397 from head:
  
    Fix CARP memory leaks on carp_if's malloc'd using M_CARP.  This occurs when
    CARP tries to free them using M_IFADDR after the last address for a virtual
    host is removed and when detaching from the parent interface.
  
  Approved by:	re (kib), ken (mentor)

Modified:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)
  stable/8/sys/netinet/ip_carp.c

Modified: stable/8/sys/netinet/ip_carp.c
==============================================================================
--- stable/8/sys/netinet/ip_carp.c	Thu Aug 20 02:33:12 2009	(r196397)
+++ stable/8/sys/netinet/ip_carp.c	Thu Aug 20 02:49:43 2009	(r196398)
@@ -501,7 +501,7 @@ carpdetach(struct carp_softc *sc, int un
 			ifpromisc(sc->sc_carpdev, 0);
 			sc->sc_carpdev->if_carp = NULL;
 			CARP_LOCK_DESTROY(cif);
-			free(cif, M_IFADDR);
+			free(cif, M_CARP);
 		} else if (unlock)
 			CARP_UNLOCK(cif);
 		sc->sc_carpdev = NULL;
@@ -1639,7 +1639,7 @@ carp_del_addr(struct carp_softc *sc, str
 		if (!--cif->vhif_nvrs) {
 			sc->sc_carpdev->if_carp = NULL;
 			CARP_LOCK_DESTROY(cif);
-			free(cif, M_IFADDR);
+			free(cif, M_CARP);
 		} else {
 			CARP_UNLOCK(cif);
 		}
@@ -1843,7 +1843,7 @@ carp_del_addr6(struct carp_softc *sc, st
 		if (!--cif->vhif_nvrs) {
 			CARP_LOCK_DESTROY(cif);
 			sc->sc_carpdev->if_carp = NULL;
-			free(cif, M_IFADDR);
+			free(cif, M_CARP);
 		} else
 			CARP_UNLOCK(cif);
 	}


More information about the svn-src-stable-8 mailing list