diff options
author | 2014-07-12 18:44:22 +0000 | |
---|---|---|
committer | 2014-07-12 18:44:22 +0000 | |
commit | dd168dc2dbd0498445c205acd3a92d235cbcb6af (patch) | |
tree | 7468232c146a34628a98058ec363c774cbe975e5 /sys/netinet | |
parent | add a size argument to free. will be used soon, but for now default to 0. (diff) | |
download | wireguard-openbsd-dd168dc2dbd0498445c205acd3a92d235cbcb6af.tar.xz wireguard-openbsd-dd168dc2dbd0498445c205acd3a92d235cbcb6af.zip |
add a size argument to free. will be used soon, but for now default to 0.
after discussions with beck deraadt kettenis.
Diffstat (limited to 'sys/netinet')
-rw-r--r-- | sys/netinet/if_ether.c | 4 | ||||
-rw-r--r-- | sys/netinet/igmp.c | 4 | ||||
-rw-r--r-- | sys/netinet/in.c | 6 | ||||
-rw-r--r-- | sys/netinet/ip_ah.c | 34 | ||||
-rw-r--r-- | sys/netinet/ip_carp.c | 20 | ||||
-rw-r--r-- | sys/netinet/ip_esp.c | 24 | ||||
-rw-r--r-- | sys/netinet/ip_ipcomp.c | 20 | ||||
-rw-r--r-- | sys/netinet/ip_ipsp.c | 12 | ||||
-rw-r--r-- | sys/netinet/ip_mroute.c | 26 | ||||
-rw-r--r-- | sys/netinet/ip_output.c | 20 | ||||
-rw-r--r-- | sys/netinet/tcp_subr.c | 4 |
11 files changed, 87 insertions, 87 deletions
diff --git a/sys/netinet/if_ether.c b/sys/netinet/if_ether.c index b3c7b813469..459a64c29f6 100644 --- a/sys/netinet/if_ether.c +++ b/sys/netinet/if_ether.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_ether.c,v 1.130 2014/07/12 14:26:00 mpi Exp $ */ +/* $OpenBSD: if_ether.c,v 1.131 2014/07/12 18:44:23 tedu Exp $ */ /* $NetBSD: if_ether.c,v 1.31 1996/05/11 12:59:58 mycroft Exp $ */ /* @@ -271,7 +271,7 @@ arp_rtrequest(int req, struct rtentry *rt) la_hold_total--; m_freem(m); } - free(la, M_RTABLE); + free(la, M_RTABLE, 0); } } diff --git a/sys/netinet/igmp.c b/sys/netinet/igmp.c index 8622e3a9853..a112ef2d6ea 100644 --- a/sys/netinet/igmp.c +++ b/sys/netinet/igmp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: igmp.c,v 1.41 2014/07/08 17:19:26 deraadt Exp $ */ +/* $OpenBSD: igmp.c,v 1.42 2014/07/12 18:44:23 tedu Exp $ */ /* $NetBSD: igmp.c,v 1.15 1996/02/13 23:41:25 christos Exp $ */ /* @@ -202,7 +202,7 @@ rti_delete(struct ifnet *ifp) for (rti = rti_head; rti != 0; rti = rti->rti_next) { if (rti->rti_ifp == ifp) { *prti = rti->rti_next; - free(rti, M_MRTABLE); + free(rti, M_MRTABLE, 0); break; } prti = &rti->rti_next; diff --git a/sys/netinet/in.c b/sys/netinet/in.c index 70e1a8d4e67..acfa84755d9 100644 --- a/sys/netinet/in.c +++ b/sys/netinet/in.c @@ -1,4 +1,4 @@ -/* $OpenBSD: in.c,v 1.100 2014/07/12 14:26:00 mpi Exp $ */ +/* $OpenBSD: in.c,v 1.101 2014/07/12 18:44:23 tedu Exp $ */ /* $NetBSD: in.c,v 1.26 1996/02/13 23:41:39 christos Exp $ */ /* @@ -1015,7 +1015,7 @@ in_addmulti(struct in_addr *ap, struct ifnet *ifp) */ memcpy(&ifr.ifr_addr, &inm->inm_sin, sizeof(inm->inm_sin)); if ((*ifp->if_ioctl)(ifp, SIOCADDMULTI,(caddr_t)&ifr) != 0) { - free(inm, M_IPMADDR); + free(inm, M_IPMADDR, 0); return (NULL); } @@ -1068,7 +1068,7 @@ in_delmulti(struct in_multi *inm) splx(s); } - free(inm, M_IPMADDR); + free(inm, M_IPMADDR, 0); } } diff --git a/sys/netinet/ip_ah.c b/sys/netinet/ip_ah.c index 8473c301549..296a689eeee 100644 --- a/sys/netinet/ip_ah.c +++ b/sys/netinet/ip_ah.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ip_ah.c,v 1.109 2014/07/09 09:30:49 henning Exp $ */ +/* $OpenBSD: ip_ah.c,v 1.110 2014/07/12 18:44:23 tedu Exp $ */ /* * The authors of this code are John Ioannidis (ji@tla.org), * Angelos D. Keromytis (kermit@csd.uch.gr) and @@ -191,7 +191,7 @@ ah_zeroize(struct tdb *tdbp) if (tdbp->tdb_amxkey) { explicit_bzero(tdbp->tdb_amxkey, tdbp->tdb_amxkeylen); - free(tdbp->tdb_amxkey, M_XDATA); + free(tdbp->tdb_amxkey, M_XDATA, 0); tdbp->tdb_amxkey = NULL; } @@ -439,7 +439,7 @@ ah_massage_headers(struct mbuf **m0, int proto, int skip, int alg, int out) /* Free, if we allocated. */ if (alloc) - free(ptr, M_XDATA); + free(ptr, M_XDATA, 0); return EINVAL; } @@ -460,7 +460,7 @@ ah_massage_headers(struct mbuf **m0, int proto, int skip, int alg, int out) /* Free, if we allocated. */ if (alloc) - free(ptr, M_XDATA); + free(ptr, M_XDATA, 0); return EINVAL; } } @@ -524,7 +524,7 @@ ah_massage_headers(struct mbuf **m0, int proto, int skip, int alg, int out) DPRINTF(("ah_massage_headers(): unexpected " "IPv6 header type %d\n", off)); if (alloc) - free(ptr, M_XDATA); + free(ptr, M_XDATA, 0); ahstat.ahs_hdrops++; m_freem(m); return EINVAL; @@ -535,7 +535,7 @@ ah_massage_headers(struct mbuf **m0, int proto, int skip, int alg, int out) if (alloc) { m_copyback(m, sizeof(struct ip6_hdr), skip - sizeof(struct ip6_hdr), ptr, M_NOWAIT); - free(ptr, M_XDATA); + free(ptr, M_XDATA, 0); } break; @@ -717,7 +717,7 @@ ah_input(struct mbuf *m, struct tdb *tdb, int skip, int protoff) if ((btsx = ah_massage_headers(&m, tdb->tdb_dst.sa.sa_family, skip, ahx->type, 0)) != 0) { /* mbuf will be free'd by callee. */ - free(tc, M_XDATA); + free(tc, M_XDATA, 0); crypto_freereq(crp); return btsx; } @@ -774,7 +774,7 @@ ah_input_cb(void *op) m = (struct mbuf *) crp->crp_buf; if (m == NULL) { /* Shouldn't happen... */ - free(tc, M_XDATA); + free(tc, M_XDATA, 0); crypto_freereq(crp); ahstat.ahs_crypto++; DPRINTF(("ah_input_cb(): bogus returned buffer from " @@ -786,7 +786,7 @@ ah_input_cb(void *op) tdb = gettdb(tc->tc_rdomain, tc->tc_spi, &tc->tc_dst, tc->tc_proto); if (tdb == NULL) { - free(tc, M_XDATA); + free(tc, M_XDATA, 0); ahstat.ahs_notdb++; DPRINTF(("ah_input_cb(): TDB is expired while in crypto")); error = EPERM; @@ -804,7 +804,7 @@ ah_input_cb(void *op) splx(s); return crypto_dispatch(crp); } - free(tc, M_XDATA); + free(tc, M_XDATA, 0); ahstat.ahs_noxform++; DPRINTF(("ah_input_cb(): crypto error %d\n", crp->crp_etype)); error = crp->crp_etype; @@ -828,7 +828,7 @@ ah_input_cb(void *op) /* Verify authenticator. */ if (timingsafe_bcmp(ptr + skip + rplen, calc, ahx->authsize)) { - free(tc, M_XDATA); + free(tc, M_XDATA, 0); DPRINTF(("ah_input(): authentication failed for " "packet in SA %s/%08x\n", @@ -850,7 +850,7 @@ ah_input_cb(void *op) m_copyback(m, protoff, sizeof(u_int8_t), &prot, M_NOWAIT); } - free(tc, M_XDATA); + free(tc, M_XDATA, 0); /* Replay window checking, if applicable. */ if (tdb->tdb_wnd > 0) { @@ -1243,7 +1243,7 @@ ah_output(struct mbuf *m, struct tdb *tdb, struct mbuf **mp, int skip, if ((len = ah_massage_headers(&m, tdb->tdb_dst.sa.sa_family, skip, ahx->type, 1)) != 0) { /* mbuf will be free'd by callee. */ - free(tc, M_XDATA); + free(tc, M_XDATA, 0); crypto_freereq(crp); return len; } @@ -1297,7 +1297,7 @@ ah_output_cb(void *op) m = (struct mbuf *) crp->crp_buf; if (m == NULL) { /* Shouldn't happen... */ - free(tc, M_XDATA); + free(tc, M_XDATA, 0); crypto_freereq(crp); ahstat.ahs_crypto++; DPRINTF(("ah_output_cb(): bogus returned buffer from " @@ -1309,7 +1309,7 @@ ah_output_cb(void *op) tdb = gettdb(tc->tc_rdomain, tc->tc_spi, &tc->tc_dst, tc->tc_proto); if (tdb == NULL) { - free(tc, M_XDATA); + free(tc, M_XDATA, 0); ahstat.ahs_notdb++; DPRINTF(("ah_output_cb(): TDB is expired while in crypto\n")); error = EPERM; @@ -1325,7 +1325,7 @@ ah_output_cb(void *op) splx(s); return crypto_dispatch(crp); } - free(tc, M_XDATA); + free(tc, M_XDATA, 0); ahstat.ahs_noxform++; DPRINTF(("ah_output_cb(): crypto error %d\n", crp->crp_etype)); error = crp->crp_etype; @@ -1339,7 +1339,7 @@ ah_output_cb(void *op) if ((tdb->tdb_flags & TDBF_SKIPCRYPTO) == 0) m_copyback(m, 0, skip, ptr, M_NOWAIT); - free(tc, M_XDATA); + free(tc, M_XDATA, 0); /* No longer needed. */ crypto_freereq(crp); diff --git a/sys/netinet/ip_carp.c b/sys/netinet/ip_carp.c index 608205c1990..481fa36f0e6 100644 --- a/sys/netinet/ip_carp.c +++ b/sys/netinet/ip_carp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ip_carp.c,v 1.231 2014/07/09 09:30:49 henning Exp $ */ +/* $OpenBSD: ip_carp.c,v 1.232 2014/07/12 18:44:23 tedu Exp $ */ /* * Copyright (c) 2002 Michael Shalayeff. All rights reserved. @@ -729,7 +729,7 @@ carp_clone_create(ifc, unit) LIST_INIT(&sc->carp_vhosts); sc->sc_vhe_count = 0; if (carp_new_vhost(sc, 0, 0)) { - free(sc, M_DEVBUF); + free(sc, M_DEVBUF, 0); return (ENOMEM); } @@ -817,8 +817,8 @@ carp_clone_destroy(struct ifnet *ifp) ether_ifdetach(ifp); if_detach(ifp); carp_destroy_vhosts(ifp->if_softc); - free(sc->sc_imo.imo_membership, M_IPMOPTS); - free(sc, M_DEVBUF); + free(sc->sc_imo.imo_membership, M_IPMOPTS, 0); + free(sc, M_DEVBUF, 0); return (0); } @@ -865,7 +865,7 @@ carpdetach(struct carp_softc *sc) if (!--cif->vhif_nvrs) { ifpromisc(sc->sc_carpdev, 0); sc->sc_carpdev->if_carp = NULL; - free(cif, M_IFADDR); + free(cif, M_IFADDR, 0); } } sc->sc_carpdev = NULL; @@ -893,7 +893,7 @@ carp_destroy_vhosts(struct carp_softc *sc) for (vhe = LIST_FIRST(&sc->carp_vhosts); vhe != NULL; vhe = nvhe) { nvhe = LIST_NEXT(vhe, vhost_entries); - free(vhe, M_DEVBUF); + free(vhe, M_DEVBUF, 0); } LIST_INIT(&sc->carp_vhosts); sc->sc_vhe_count = 0; @@ -1681,7 +1681,7 @@ carp_set_ifp(struct carp_softc *sc, struct ifnet *ifp) if (ncif == NULL) return (ENOBUFS); if ((error = ifpromisc(ifp, 1))) { - free(ncif, M_IFADDR); + free(ncif, M_IFADDR, 0); return (error); } @@ -2547,7 +2547,7 @@ carp_ether_addmulti(struct carp_softc *sc, struct ifreq *ifr) ioctl_failed: LIST_REMOVE(mc, mc_entries); - free(mc, M_DEVBUF); + free(mc, M_DEVBUF, 0); alloc_failed: (void)ether_delmulti(ifr, (struct arpcom *)&sc->sc_ac); @@ -2594,7 +2594,7 @@ carp_ether_delmulti(struct carp_softc *sc, struct ifreq *ifr) if (error == 0) { /* And forget about this address. */ LIST_REMOVE(mc, mc_entries); - free(mc, M_DEVBUF); + free(mc, M_DEVBUF, 0); } else (void)ether_addmulti(ifr, (struct arpcom *)&sc->sc_ac); return (error); @@ -2626,6 +2626,6 @@ carp_ether_purgemulti(struct carp_softc *sc) memcpy(&ifr->ifr_addr, &mc->mc_addr, mc->mc_addr.ss_len); (void)(*ifp->if_ioctl)(ifp, SIOCDELMULTI, (caddr_t)ifr); LIST_REMOVE(mc, mc_entries); - free(mc, M_DEVBUF); + free(mc, M_DEVBUF, 0); } } diff --git a/sys/netinet/ip_esp.c b/sys/netinet/ip_esp.c index bf29436a217..62c53fffee3 100644 --- a/sys/netinet/ip_esp.c +++ b/sys/netinet/ip_esp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ip_esp.c,v 1.124 2014/07/09 09:30:49 henning Exp $ */ +/* $OpenBSD: ip_esp.c,v 1.125 2014/07/12 18:44:23 tedu Exp $ */ /* * The authors of this code are John Ioannidis (ji@tla.org), * Angelos D. Keromytis (kermit@csd.uch.gr) and @@ -304,13 +304,13 @@ esp_zeroize(struct tdb *tdbp) if (tdbp->tdb_amxkey) { explicit_bzero(tdbp->tdb_amxkey, tdbp->tdb_amxkeylen); - free(tdbp->tdb_amxkey, M_XDATA); + free(tdbp->tdb_amxkey, M_XDATA, 0); tdbp->tdb_amxkey = NULL; } if (tdbp->tdb_emxkey) { explicit_bzero(tdbp->tdb_emxkey, tdbp->tdb_emxkeylen); - free(tdbp->tdb_emxkey, M_XDATA); + free(tdbp->tdb_emxkey, M_XDATA, 0); tdbp->tdb_emxkey = NULL; } @@ -554,7 +554,7 @@ esp_input_cb(void *op) m = (struct mbuf *) crp->crp_buf; if (m == NULL) { /* Shouldn't happen... */ - free(tc, M_XDATA); + free(tc, M_XDATA, 0); crypto_freereq(crp); espstat.esps_crypto++; DPRINTF(("esp_input_cb(): bogus returned buffer from crypto\n")); @@ -565,7 +565,7 @@ esp_input_cb(void *op) tdb = gettdb(tc->tc_rdomain, tc->tc_spi, &tc->tc_dst, tc->tc_proto); if (tdb == NULL) { - free(tc, M_XDATA); + free(tc, M_XDATA, 0); espstat.esps_notdb++; DPRINTF(("esp_input_cb(): TDB is expired while in crypto")); error = EPERM; @@ -583,7 +583,7 @@ esp_input_cb(void *op) splx(s); return crypto_dispatch(crp); } - free(tc, M_XDATA); + free(tc, M_XDATA, 0); espstat.esps_noxform++; DPRINTF(("esp_input_cb(): crypto error %d\n", crp->crp_etype)); error = crp->crp_etype; @@ -605,7 +605,7 @@ esp_input_cb(void *op) /* Verify authenticator */ if (timingsafe_bcmp(ptr, aalg, esph->authsize)) { - free(tc, M_XDATA); + free(tc, M_XDATA, 0); DPRINTF(("esp_input_cb(): authentication failed for packet in SA %s/%08x\n", ipsp_address(tdb->tdb_dst), ntohl(tdb->tdb_spi))); espstat.esps_badauth++; error = EACCES; @@ -616,7 +616,7 @@ esp_input_cb(void *op) /* Remove trailing authenticator */ m_adj(m, -(esph->authsize)); } - free(tc, M_XDATA); + free(tc, M_XDATA, 0); /* Replay window checking, if appropriate */ if (tdb->tdb_wnd > 0) { @@ -1059,7 +1059,7 @@ esp_output_cb(void *op) m = (struct mbuf *) crp->crp_buf; if (m == NULL) { /* Shouldn't happen... */ - free(tc, M_XDATA); + free(tc, M_XDATA, 0); crypto_freereq(crp); espstat.esps_crypto++; DPRINTF(("esp_output_cb(): bogus returned buffer from " @@ -1072,7 +1072,7 @@ esp_output_cb(void *op) tdb = gettdb(tc->tc_rdomain, tc->tc_spi, &tc->tc_dst, tc->tc_proto); if (tdb == NULL) { - free(tc, M_XDATA); + free(tc, M_XDATA, 0); espstat.esps_notdb++; DPRINTF(("esp_output_cb(): TDB is expired while in crypto\n")); error = EPERM; @@ -1088,14 +1088,14 @@ esp_output_cb(void *op) splx(s); return crypto_dispatch(crp); } - free(tc, M_XDATA); + free(tc, M_XDATA, 0); espstat.esps_noxform++; DPRINTF(("esp_output_cb(): crypto error %d\n", crp->crp_etype)); error = crp->crp_etype; goto baddone; } - free(tc, M_XDATA); + free(tc, M_XDATA, 0); /* Release crypto descriptors. */ crypto_freereq(crp); diff --git a/sys/netinet/ip_ipcomp.c b/sys/netinet/ip_ipcomp.c index 6e753eb8d51..021ff99c095 100644 --- a/sys/netinet/ip_ipcomp.c +++ b/sys/netinet/ip_ipcomp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ip_ipcomp.c,v 1.34 2014/07/09 09:30:49 henning Exp $ */ +/* $OpenBSD: ip_ipcomp.c,v 1.35 2014/07/12 18:44:23 tedu Exp $ */ /* * Copyright (c) 2001 Jean-Jacques Bernard-Gundol (jj@wabbitt.org) @@ -230,7 +230,7 @@ ipcomp_input_cb(op) m = (struct mbuf *) crp->crp_buf; if (m == NULL) { /* Shouldn't happen... */ - free(tc, M_XDATA); + free(tc, M_XDATA, 0); crypto_freereq(crp); ipcompstat.ipcomps_crypto++; DPRINTF(("ipcomp_input_cb(): bogus returned buffer from crypto\n")); @@ -241,7 +241,7 @@ ipcomp_input_cb(op) tdb = gettdb(tc->tc_rdomain, tc->tc_spi, &tc->tc_dst, tc->tc_proto); if (tdb == NULL) { - free(tc, M_XDATA); + free(tc, M_XDATA, 0); ipcompstat.ipcomps_notdb++; DPRINTF(("ipcomp_input_cb(): TDB expired while in crypto")); error = EPERM; @@ -255,7 +255,7 @@ ipcomp_input_cb(op) /* Hard expiration */ if ((tdb->tdb_flags & TDBF_BYTES) && (tdb->tdb_cur_bytes >= tdb->tdb_exp_bytes)) { - free(tc, M_XDATA); + free(tc, M_XDATA, 0); pfkeyv2_expire(tdb, SADB_EXT_LIFETIME_HARD); tdb_delete(tdb); error = ENXIO; @@ -277,14 +277,14 @@ ipcomp_input_cb(op) splx(s); return crypto_dispatch(crp); } - free(tc, M_XDATA); + free(tc, M_XDATA, 0); ipcompstat.ipcomps_noxform++; DPRINTF(("ipcomp_input_cb(): crypto error %d\n", crp->crp_etype)); error = crp->crp_etype; goto baddone; } - free(tc, M_XDATA); + free(tc, M_XDATA, 0); /* Length of data after processing */ clen = crp->crp_olen; @@ -573,7 +573,7 @@ ipcomp_output_cb(cp) m = (struct mbuf *) crp->crp_buf; if (m == NULL) { /* Shouldn't happen... */ - free(tc, M_XDATA); + free(tc, M_XDATA, 0); crypto_freereq(crp); ipcompstat.ipcomps_crypto++; DPRINTF(("ipcomp_output_cb(): bogus returned buffer from " @@ -585,7 +585,7 @@ ipcomp_output_cb(cp) tdb = gettdb(tc->tc_rdomain, tc->tc_spi, &tc->tc_dst, tc->tc_proto); if (tdb == NULL) { - free(tc, M_XDATA); + free(tc, M_XDATA, 0); ipcompstat.ipcomps_notdb++; DPRINTF(("ipcomp_output_cb(): TDB expired while in crypto\n")); error = EPERM; @@ -601,14 +601,14 @@ ipcomp_output_cb(cp) splx(s); return crypto_dispatch(crp); } - free(tc, M_XDATA); + free(tc, M_XDATA, 0); ipcompstat.ipcomps_noxform++; DPRINTF(("ipcomp_output_cb(): crypto error %d\n", crp->crp_etype)); error = crp->crp_etype; goto baddone; } - free(tc, M_XDATA); + free(tc, M_XDATA, 0); /* Check sizes. */ if (rlen < crp->crp_olen) { diff --git a/sys/netinet/ip_ipsp.c b/sys/netinet/ip_ipsp.c index 5835011215b..526d2e617b7 100644 --- a/sys/netinet/ip_ipsp.c +++ b/sys/netinet/ip_ipsp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ip_ipsp.c,v 1.195 2014/07/08 17:19:26 deraadt Exp $ */ +/* $OpenBSD: ip_ipsp.c,v 1.196 2014/07/12 18:44:23 tedu Exp $ */ /* * The authors of this code are John Ioannidis (ji@tla.org), * Angelos D. Keromytis (kermit@csd.uch.gr), @@ -638,13 +638,13 @@ tdb_rehash(void) } } - free(tdbh, M_TDB); + free(tdbh, M_TDB, 0); tdbh = new_tdbh; - free(tdbaddr, M_TDB); + free(tdbaddr, M_TDB, 0); tdbaddr = new_tdbaddr; - free(tdbsrc, M_TDB); + free(tdbsrc, M_TDB, 0); tdbsrc = new_srcaddr; } @@ -892,7 +892,7 @@ tdb_free(struct tdb *tdbp) if ((tdbp->tdb_inext) && (tdbp->tdb_inext->tdb_onext == tdbp)) tdbp->tdb_inext->tdb_onext = NULL; - free(tdbp, M_TDB); + free(tdbp, M_TDB, 0); } /* @@ -1049,7 +1049,7 @@ ipsp_reffree(struct ipsec_ref *ipr) ipr->ref_count, ipr, ipr->ref_len, ipr->ref_malloctype); #endif if (--ipr->ref_count <= 0) - free(ipr, ipr->ref_malloctype); + free(ipr, ipr->ref_malloctype, 0); } /* Mark a TDB as TDBF_SKIPCRYPTO. */ diff --git a/sys/netinet/ip_mroute.c b/sys/netinet/ip_mroute.c index d7afaf85743..f2583c987d6 100644 --- a/sys/netinet/ip_mroute.c +++ b/sys/netinet/ip_mroute.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ip_mroute.c,v 1.66 2014/04/21 12:22:26 henning Exp $ */ +/* $OpenBSD: ip_mroute.c,v 1.67 2014/07/12 18:44:23 tedu Exp $ */ /* $NetBSD: ip_mroute.c,v 1.85 2004/04/26 01:31:57 matt Exp $ */ /* @@ -604,7 +604,7 @@ ip_mrouter_done() } memset(nexpire, 0, sizeof(nexpire)); - free(mfchashtbl, M_MRTABLE); + free(mfchashtbl, M_MRTABLE, 0); mfchashtbl = NULL; bw_upcalls_n = 0; @@ -1021,11 +1021,11 @@ expire_mfc(struct mfc *rt) for (rte = rt->mfc_stall; rte != NULL; rte = nrte) { nrte = rte->next; m_freem(rte->m); - free(rte, M_MRTABLE); + free(rte, M_MRTABLE, 0); } LIST_REMOVE(rt, mfc_hash); - free(rt, M_MRTABLE); + free(rt, M_MRTABLE, 0); } /* @@ -1118,7 +1118,7 @@ add_mfc(struct mbuf *m) ip_mdq(rte->m, rte->ifp, rt); } m_freem(rte->m); - free(rte, M_MRTABLE); + free(rte, M_MRTABLE, 0); } } } @@ -1215,7 +1215,7 @@ del_mfc(struct mbuf *m) rt->mfc_bw_meter = NULL; LIST_REMOVE(rt, mfc_hash); - free(rt, M_MRTABLE); + free(rt, M_MRTABLE, 0); splx(s); return (0); @@ -1331,7 +1331,7 @@ ip_mforward(struct mbuf *m, struct ifnet *ifp) mb0 = m_copy(m, 0, M_COPYALL); M_PULLUP(mb0, hlen); if (mb0 == NULL) { - free(rte, M_MRTABLE); + free(rte, M_MRTABLE, 0); splx(s); return (ENOBUFS); } @@ -1392,9 +1392,9 @@ ip_mforward(struct mbuf *m, struct ifnet *ifp) "socket queue full\n"); ++mrtstat.mrts_upq_sockfull; fail1: - free(rt, M_MRTABLE); + free(rt, M_MRTABLE, 0); fail: - free(rte, M_MRTABLE); + free(rte, M_MRTABLE, 0); m_freem(mb0); splx(s); return (ENOBUFS); @@ -1437,7 +1437,7 @@ ip_mforward(struct mbuf *m, struct ifnet *ifp) if (++npkts > MAX_UPQ) { mrtstat.mrts_upq_ovflw++; non_fatal: - free(rte, M_MRTABLE); + free(rte, M_MRTABLE, 0); m_freem(mb0); splx(s); return (0); @@ -1487,7 +1487,7 @@ expire_upcalls(void *v) struct bw_meter *x = rt->mfc_bw_meter; rt->mfc_bw_meter = x->bm_mfc_next; - free(x, M_BWMETER); + free(x, M_BWMETER, 0); } ++mrtstat.mrts_cache_cleanups; @@ -1877,7 +1877,7 @@ free_bw_list(struct bw_meter *list) list = list->bm_mfc_next; unschedule_bw_meter(x); - free(x, M_BWMETER); + free(x, M_BWMETER, 0); } } @@ -1945,7 +1945,7 @@ del_bw_upcall(struct mbuf *m) unschedule_bw_meter(x); splx(s); /* Free the bw_meter entry */ - free(x, M_BWMETER); + free(x, M_BWMETER, 0); return (0); } else { splx(s); diff --git a/sys/netinet/ip_output.c b/sys/netinet/ip_output.c index cbec4e7f983..eb7db875269 100644 --- a/sys/netinet/ip_output.c +++ b/sys/netinet/ip_output.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ip_output.c,v 1.264 2014/07/11 15:25:44 henning Exp $ */ +/* $OpenBSD: ip_output.c,v 1.265 2014/07/12 18:44:23 tedu Exp $ */ /* $NetBSD: ip_output.c,v 1.28 1996/02/13 23:43:07 christos Exp $ */ /* @@ -1238,7 +1238,7 @@ ip_ctloutput(int op, struct socket *so, int level, int optname, if (ipr->ref_type < IPSP_IDENTITY_PREFIX || ipr->ref_type > IPSP_IDENTITY_CONNECTION || ((char *)(ipr + 1))[ipr->ref_len - 1]) { - free(ipr, M_CREDENTIALS); + free(ipr, M_CREDENTIALS, 0); error = EINVAL; } else { if (inp->inp_ipo->ipo_srcid != NULL) @@ -1251,7 +1251,7 @@ ip_ctloutput(int op, struct socket *so, int level, int optname, if (ipr->ref_type < IPSP_IDENTITY_PREFIX || ipr->ref_type > IPSP_IDENTITY_CONNECTION || ((char *)(ipr + 1))[ipr->ref_len - 1]) { - free(ipr, M_CREDENTIALS); + free(ipr, M_CREDENTIALS, 0); error = EINVAL; } else { if (inp->inp_ipo->ipo_dstid != NULL) @@ -1262,7 +1262,7 @@ ip_ctloutput(int op, struct socket *so, int level, int optname, case IP_IPSEC_LOCAL_CRED: if (ipr->ref_type < IPSP_CRED_KEYNOTE || ipr->ref_type > IPSP_CRED_X509) { - free(ipr, M_CREDENTIALS); + free(ipr, M_CREDENTIALS, 0); error = EINVAL; } else { if (inp->inp_ipo->ipo_local_cred != NULL) @@ -1273,7 +1273,7 @@ ip_ctloutput(int op, struct socket *so, int level, int optname, case IP_IPSEC_LOCAL_AUTH: if (ipr->ref_type < IPSP_AUTH_PASSPHRASE || ipr->ref_type > IPSP_AUTH_RSA) { - free(ipr, M_CREDENTIALS); + free(ipr, M_CREDENTIALS, 0); error = EINVAL; } else { if (inp->inp_ipo->ipo_local_auth != NULL) @@ -1825,7 +1825,7 @@ ip_setmoptions(int optname, struct ip_moptions **imop, struct mbuf *m, bcopy(omships, nmships, sizeof(*omships) * imo->imo_max_memberships); - free(omships, M_IPMOPTS); + free(omships, M_IPMOPTS, 0); imo->imo_membership = nmships; imo->imo_max_memberships = newmax; } @@ -1915,8 +1915,8 @@ ip_setmoptions(int optname, struct ip_moptions **imop, struct mbuf *m, imo->imo_multicast_ttl == IP_DEFAULT_MULTICAST_TTL && imo->imo_multicast_loop == IP_DEFAULT_MULTICAST_LOOP && imo->imo_num_memberships == 0) { - free(imo->imo_membership , M_IPMOPTS); - free(*imop, M_IPMOPTS); + free(imo->imo_membership , M_IPMOPTS, 0); + free(*imop, M_IPMOPTS, 0); *imop = NULL; } @@ -1980,8 +1980,8 @@ ip_freemoptions(struct ip_moptions *imo) if (imo != NULL) { for (i = 0; i < imo->imo_num_memberships; ++i) in_delmulti(imo->imo_membership[i]); - free(imo->imo_membership, M_IPMOPTS); - free(imo, M_IPMOPTS); + free(imo->imo_membership, M_IPMOPTS, 0); + free(imo, M_IPMOPTS, 0); } } diff --git a/sys/netinet/tcp_subr.c b/sys/netinet/tcp_subr.c index e0e4773b69a..74d8d7264c9 100644 --- a/sys/netinet/tcp_subr.c +++ b/sys/netinet/tcp_subr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tcp_subr.c,v 1.129 2014/04/21 12:22:26 henning Exp $ */ +/* $OpenBSD: tcp_subr.c,v 1.130 2014/07/12 18:44:23 tedu Exp $ */ /* $NetBSD: tcp_subr.c,v 1.22 1996/02/13 23:44:00 christos Exp $ */ /* @@ -1012,7 +1012,7 @@ tcp_signature_tdb_zeroize(tdbp) { if (tdbp->tdb_amxkey) { explicit_bzero(tdbp->tdb_amxkey, tdbp->tdb_amxkeylen); - free(tdbp->tdb_amxkey, M_XDATA); + free(tdbp->tdb_amxkey, M_XDATA, 0); tdbp->tdb_amxkey = NULL; } |