summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwill <will@FreeBSD.org>2009-08-20 02:33:12 +0000
committerwill <will@FreeBSD.org>2009-08-20 02:33:12 +0000
commit12476e655030b51898ca1cfaa89401f3a182aba1 (patch)
treee477d48781dee29e0952cf04ceb551994869a556
parent937d93c43702f213aeb338d3ef3d03a5b217f82f (diff)
downloadFreeBSD-src-12476e655030b51898ca1cfaa89401f3a182aba1.zip
FreeBSD-src-12476e655030b51898ca1cfaa89401f3a182aba1.tar.gz
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. Reviewed by: mlaier Approved by: re (kib), ken (mentor)
-rw-r--r--sys/netinet/ip_carp.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/netinet/ip_carp.c b/sys/netinet/ip_carp.c
index 18e446f..e3ffe5a 100644
--- a/sys/netinet/ip_carp.c
+++ b/sys/netinet/ip_carp.c
@@ -501,7 +501,7 @@ carpdetach(struct carp_softc *sc, int unlock)
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, struct sockaddr_in *sin)
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, struct sockaddr_in6 *sin6)
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);
}
OpenPOWER on IntegriCloud