From dd168dc2dbd0498445c205acd3a92d235cbcb6af Mon Sep 17 00:00:00 2001 From: tedu Date: Sat, 12 Jul 2014 18:44:22 +0000 Subject: [PATCH] add a size argument to free. will be used soon, but for now default to 0. after discussions with beck deraadt kettenis. --- sys/net/bpf.c | 22 +++---- sys/net/bridgestp.c | 6 +- sys/net/bsd-comp.c | 8 +-- sys/net/hfsc.c | 12 ++-- sys/net/if.c | 24 ++++---- sys/net/if_bridge.c | 26 ++++---- sys/net/if_enc.c | 10 ++-- sys/net/if_ethersubr.c | 6 +- sys/net/if_gif.c | 16 ++--- sys/net/if_gre.c | 4 +- sys/net/if_loop.c | 4 +- sys/net/if_media.c | 6 +- sys/net/if_mpe.c | 4 +- sys/net/if_pflog.c | 6 +- sys/net/if_pflow.c | 6 +- sys/net/if_pfsync.c | 6 +- sys/net/if_ppp.c | 16 ++--- sys/net/if_pppoe.c | 34 +++++------ sys/net/if_pppx.c | 8 +-- sys/net/if_sl.c | 4 +- sys/net/if_spppsubr.c | 48 +++++++-------- sys/net/if_trunk.c | 16 ++--- sys/net/if_tun.c | 6 +- sys/net/if_vether.c | 4 +- sys/net/if_vlan.c | 10 ++-- sys/net/if_vxlan.c | 6 +- sys/net/pf_if.c | 6 +- sys/net/pf_ioctl.c | 88 ++++++++++++++-------------- sys/net/pf_ruleset.c | 4 +- sys/net/pf_table.c | 6 +- sys/net/pfkey.c | 8 +-- sys/net/pfkeyv2.c | 24 ++++---- sys/net/pfkeyv2_convert.c | 8 +-- sys/net/pipex.c | 18 +++--- sys/net/ppp-deflate.c | 12 ++-- sys/net/radix.c | 4 +- sys/net/raw_cb.c | 4 +- sys/net/route.c | 26 ++++---- sys/net/rtsock.c | 16 ++--- sys/net/trunklacp.c | 8 +-- sys/net80211/ieee80211_crypto.c | 4 +- sys/net80211/ieee80211_crypto_bip.c | 4 +- sys/net80211/ieee80211_crypto_ccmp.c | 4 +- sys/net80211/ieee80211_crypto_tkip.c | 4 +- sys/net80211/ieee80211_crypto_wep.c | 4 +- sys/net80211/ieee80211_input.c | 10 ++-- sys/net80211/ieee80211_node.c | 12 ++-- sys/net80211/ieee80211_proto.c | 4 +- sys/netinet/if_ether.c | 4 +- sys/netinet/igmp.c | 4 +- sys/netinet/in.c | 6 +- sys/netinet/ip_ah.c | 34 +++++------ sys/netinet/ip_carp.c | 20 +++---- sys/netinet/ip_esp.c | 24 ++++---- sys/netinet/ip_ipcomp.c | 20 +++---- sys/netinet/ip_ipsp.c | 12 ++-- sys/netinet/ip_mroute.c | 26 ++++---- sys/netinet/ip_output.c | 20 +++---- sys/netinet/tcp_subr.c | 4 +- sys/netinet6/frag6.c | 28 ++++----- sys/netinet6/in6.c | 16 ++--- sys/netinet6/ip6_mroute.c | 30 +++++----- sys/netinet6/ip6_output.c | 24 ++++---- sys/netinet6/nd6.c | 8 +-- sys/netinet6/nd6_nbr.c | 10 ++-- sys/netinet6/nd6_rtr.c | 10 ++-- sys/netinet6/raw_ip6.c | 4 +- 67 files changed, 450 insertions(+), 450 deletions(-) diff --git a/sys/net/bpf.c b/sys/net/bpf.c index a8bbb5ac386..e3a7f96fdc3 100644 --- a/sys/net/bpf.c +++ b/sys/net/bpf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bpf.c,v 1.102 2014/07/12 11:27:45 henning Exp $ */ +/* $OpenBSD: bpf.c,v 1.103 2014/07/12 18:44:22 tedu Exp $ */ /* $NetBSD: bpf.c,v 1.33 1997/02/21 23:59:35 thorpej Exp $ */ /* @@ -913,7 +913,7 @@ bpf_setf(struct bpf_d *d, struct bpf_program *fp, int wf) d->bd_rfilter = NULL; bpf_reset_d(d); splx(s); - free(old, M_DEVBUF); + free(old, M_DEVBUF, 0); return (0); } flen = fp->bf_len; @@ -931,11 +931,11 @@ bpf_setf(struct bpf_d *d, struct bpf_program *fp, int wf) d->bd_rfilter = fcode; bpf_reset_d(d); splx(s); - free(old, M_DEVBUF); + free(old, M_DEVBUF, 0); return (0); } - free(fcode, M_DEVBUF); + free(fcode, M_DEVBUF, 0); return (EINVAL); } @@ -1455,11 +1455,11 @@ bpf_freed(struct bpf_d *d) if (--d->bd_ref > 0) return; - free(d->bd_sbuf, M_DEVBUF); - free(d->bd_hbuf, M_DEVBUF); - free(d->bd_fbuf, M_DEVBUF); - free(d->bd_rfilter, M_DEVBUF); - free(d->bd_wfilter, M_DEVBUF); + free(d->bd_sbuf, M_DEVBUF, 0); + free(d->bd_hbuf, M_DEVBUF, 0); + free(d->bd_fbuf, M_DEVBUF, 0); + free(d->bd_rfilter, M_DEVBUF, 0); + free(d->bd_wfilter, M_DEVBUF, 0); bpfilter_destroy(d); } @@ -1528,7 +1528,7 @@ bpfdetach(struct ifnet *ifp) } } - free(bp, M_DEVBUF); + free(bp, M_DEVBUF, 0); } else pbp = &bp->bif_next; } @@ -1599,7 +1599,7 @@ void bpfilter_destroy(struct bpf_d *bd) { LIST_REMOVE(bd, bd_list); - free(bd, M_DEVBUF); + free(bd, M_DEVBUF, 0); } /* diff --git a/sys/net/bridgestp.c b/sys/net/bridgestp.c index 3217eb8cb5d..20312766543 100644 --- a/sys/net/bridgestp.c +++ b/sys/net/bridgestp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bridgestp.c,v 1.47 2014/04/19 15:54:39 henning Exp $ */ +/* $OpenBSD: bridgestp.c,v 1.48 2014/07/12 18:44:22 tedu Exp $ */ /* * Copyright (c) 2000 Jason L. Wright (jason@thought.net) @@ -1957,7 +1957,7 @@ bstp_destroy(struct bstp_state *bs) if (!LIST_EMPTY(&bs->bs_bplist)) panic("bstp still active"); - free(bs, M_DEVBUF); + free(bs, M_DEVBUF, 0); } void @@ -2033,7 +2033,7 @@ bstp_delete(struct bstp_port *bp) LIST_REMOVE(bp, bp_next); bp->bp_bs = NULL; bp->bp_active = 0; - free(bp, M_DEVBUF); + free(bp, M_DEVBUF, 0); bstp_initialization(bs); } diff --git a/sys/net/bsd-comp.c b/sys/net/bsd-comp.c index 84190e5057a..21055eb59cd 100644 --- a/sys/net/bsd-comp.c +++ b/sys/net/bsd-comp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bsd-comp.c,v 1.7 2007/09/15 16:43:51 henning Exp $ */ +/* $OpenBSD: bsd-comp.c,v 1.8 2014/07/12 18:44:22 tedu Exp $ */ /* $NetBSD: bsd-comp.c,v 1.6 1996/10/13 02:10:58 christos Exp $ */ /* Because this code is derived from the 4.3BSD compress source: @@ -356,7 +356,7 @@ bsd_alloc(options, opt_len, decomp) db->lens = malloc((maxmaxcode+1) * sizeof(db->lens[0]), M_DEVBUF, M_NOWAIT); if (!db->lens) { - free(db, M_DEVBUF); + free(db, M_DEVBUF, 0); return NULL; } } @@ -377,8 +377,8 @@ bsd_free(state) struct bsd_db *db = (struct bsd_db *) state; if (db->lens) - free(db->lens, M_DEVBUF); - free(db, M_DEVBUF); + free(db->lens, M_DEVBUF, 0); + free(db, M_DEVBUF, 0); } static void * diff --git a/sys/net/hfsc.c b/sys/net/hfsc.c index 2a5b755cf84..dc84a441b3c 100644 --- a/sys/net/hfsc.c +++ b/sys/net/hfsc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: hfsc.c,v 1.10 2014/06/30 12:47:23 pelikan Exp $ */ +/* $OpenBSD: hfsc.c,v 1.11 2014/07/12 18:44:22 tedu Exp $ */ /* * Copyright (c) 2012-2013 Henning Brauer @@ -150,7 +150,7 @@ hfsc_grow_class_tbl(struct hfsc_if *hif, u_int howmany) hif->hif_class_tbl = newtbl; hif->hif_allocated = howmany; - free(old, M_DEVBUF); + free(old, M_DEVBUF, 0); } int @@ -188,8 +188,8 @@ hfsc_detach(struct ifnet *ifp) ifp->if_snd.ifq_hfsc = NULL; hfsc_ellist_destroy(hif->hif_eligible); - free(hif->hif_class_tbl, M_DEVBUF); - free(hif, M_DEVBUF); + free(hif->hif_class_tbl, M_DEVBUF, 0); + free(hif, M_DEVBUF, 0); return (0); } @@ -1007,7 +1007,7 @@ hfsc_ellist_alloc(void) void hfsc_ellist_destroy(hfsc_ellist_t *head) { - free(head, M_DEVBUF); + free(head, M_DEVBUF, 0); } void @@ -1107,7 +1107,7 @@ hfsc_actlist_alloc(void) void hfsc_actlist_destroy(hfsc_actlist_t *head) { - free(head, M_DEVBUF); + free(head, M_DEVBUF, 0); } void diff --git a/sys/net/if.c b/sys/net/if.c index fe04b75bfa5..c3252652f79 100644 --- a/sys/net/if.c +++ b/sys/net/if.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if.c,v 1.296 2014/07/12 16:10:04 henning Exp $ */ +/* $OpenBSD: if.c,v 1.297 2014/07/12 18:44:22 tedu Exp $ */ /* $NetBSD: if.c,v 1.35 1996/05/07 05:26:04 thorpej Exp $ */ /* @@ -274,7 +274,7 @@ if_attachsetup(struct ifnet *ifp) q = (caddr_t)malloc(n, M_IFADDR, M_WAITOK|M_ZERO); if (ifindex2ifnet) { bcopy((caddr_t)ifindex2ifnet, q, m); - free((caddr_t)ifindex2ifnet, M_IFADDR); + free((caddr_t)ifindex2ifnet, M_IFADDR, 0); } ifindex2ifnet = (struct ifnet **)q; } @@ -597,9 +597,9 @@ do { \ } } - free(ifp->if_addrhooks, M_TEMP); - free(ifp->if_linkstatehooks, M_TEMP); - free(ifp->if_detachhooks, M_TEMP); + free(ifp->if_addrhooks, M_TEMP, 0); + free(ifp->if_linkstatehooks, M_TEMP, 0); + free(ifp->if_detachhooks, M_TEMP, 0); for (dp = domains; dp; dp = dp->dom_next) { if (dp->dom_ifdetach && ifp->if_afdata[dp->dom_family]) @@ -834,7 +834,7 @@ if_congestion_clear(void *arg) struct timeout *to = ifq->ifq_congestion; ifq->ifq_congestion = NULL; - free(to, M_TEMP); + free(to, M_TEMP, 0); } /* @@ -1871,7 +1871,7 @@ if_addgroup(struct ifnet *ifp, const char *groupname) return (ENOMEM); if ((ifgm = malloc(sizeof(*ifgm), M_TEMP, M_NOWAIT)) == NULL) { - free(ifgl, M_TEMP); + free(ifgl, M_TEMP, 0); return (ENOMEM); } @@ -1880,8 +1880,8 @@ if_addgroup(struct ifnet *ifp, const char *groupname) break; if (ifg == NULL && (ifg = if_creategroup(groupname)) == NULL) { - free(ifgl, M_TEMP); - free(ifgm, M_TEMP); + free(ifgl, M_TEMP, 0); + free(ifgm, M_TEMP, 0); return (ENOMEM); } @@ -1922,7 +1922,7 @@ if_delgroup(struct ifnet *ifp, const char *groupname) if (ifgm != NULL) { TAILQ_REMOVE(&ifgl->ifgl_group->ifg_members, ifgm, ifgm_next); - free(ifgm, M_TEMP); + free(ifgm, M_TEMP, 0); } if (--ifgl->ifgl_group->ifg_refcnt == 0) { @@ -1930,10 +1930,10 @@ if_delgroup(struct ifnet *ifp, const char *groupname) #if NPF > 0 pfi_detach_ifgroup(ifgl->ifgl_group); #endif - free(ifgl->ifgl_group, M_TEMP); + free(ifgl->ifgl_group, M_TEMP, 0); } - free(ifgl, M_TEMP); + free(ifgl, M_TEMP, 0); #if NPF > 0 pfi_group_change(groupname); diff --git a/sys/net/if_bridge.c b/sys/net/if_bridge.c index b8aac235601..756aac0ef9a 100644 --- a/sys/net/if_bridge.c +++ b/sys/net/if_bridge.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_bridge.c,v 1.224 2014/07/09 09:30:49 henning Exp $ */ +/* $OpenBSD: if_bridge.c,v 1.225 2014/07/12 18:44:22 tedu Exp $ */ /* * Copyright (c) 1999, 2000 Jason L. Wright (jason@thought.net) @@ -195,7 +195,7 @@ bridge_clone_create(struct if_clone *ifc, int unit) sc->sc_stp = bstp_create(&sc->sc_if); if (!sc->sc_stp) { - free(sc, M_DEVBUF); + free(sc, M_DEVBUF, 0); return (ENOMEM); } @@ -248,7 +248,7 @@ bridge_clone_destroy(struct ifnet *ifp) bridge_delete(sc, bif); while ((bif = TAILQ_FIRST(&sc->sc_spanlist)) != NULL) { TAILQ_REMOVE(&sc->sc_spanlist, bif, next); - free(bif, M_DEVBUF); + free(bif, M_DEVBUF, 0); } s = splnet(); @@ -258,7 +258,7 @@ bridge_clone_destroy(struct ifnet *ifp) bstp_destroy(sc->sc_stp); if_detach(ifp); - free(sc, M_DEVBUF); + free(sc, M_DEVBUF, 0); return (0); } @@ -276,7 +276,7 @@ bridge_delete(struct bridge_softc *sc, struct bridge_iflist *p) TAILQ_REMOVE(&sc->sc_iflist, p, next); bridge_rtdelete(sc, p->ifp, 0); bridge_flushrule(p); - free(p, M_DEVBUF); + free(p, M_DEVBUF, 0); return (error); } @@ -444,7 +444,7 @@ bridge_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) if (strncmp(p->ifp->if_xname, req->ifbr_ifsname, sizeof(p->ifp->if_xname)) == 0) { TAILQ_REMOVE(&sc->sc_spanlist, p, next); - free(p, M_DEVBUF); + free(p, M_DEVBUF, 0); break; } } @@ -817,7 +817,7 @@ bridge_bifconf(struct bridge_softc *sc, struct ifbifconf *bifc) done: if (breq != NULL) - free(breq, M_DEVBUF); + free(breq, M_DEVBUF, 0); bifc->ifbic_len = i * sizeof(*breq); return (error); } @@ -1886,7 +1886,7 @@ bridge_rtage(struct bridge_softc *sc) p = LIST_NEXT(n, brt_next); LIST_REMOVE(n, brt_next); sc->sc_brtcnt--; - free(n, M_DEVBUF); + free(n, M_DEVBUF, 0); n = p; } } @@ -1945,7 +1945,7 @@ bridge_rtflush(struct bridge_softc *sc, int full) p = LIST_NEXT(n, brt_next); LIST_REMOVE(n, brt_next); sc->sc_brtcnt--; - free(n, M_DEVBUF); + free(n, M_DEVBUF, 0); n = p; } else n = LIST_NEXT(n, brt_next); @@ -1967,7 +1967,7 @@ bridge_rtdaddr(struct bridge_softc *sc, struct ether_addr *ea) if (bcmp(ea, &p->brt_addr, sizeof(p->brt_addr)) == 0) { LIST_REMOVE(p, brt_next); sc->sc_brtcnt--; - free(p, M_DEVBUF); + free(p, M_DEVBUF, 0); return (0); } } @@ -2004,7 +2004,7 @@ bridge_rtdelete(struct bridge_softc *sc, struct ifnet *ifp, int dynonly) p = LIST_NEXT(n, brt_next); LIST_REMOVE(n, brt_next); sc->sc_brtcnt--; - free(n, M_DEVBUF); + free(n, M_DEVBUF, 0); n = p; } } @@ -2183,7 +2183,7 @@ bridge_flushrule(struct bridge_iflist *bif) #if NPF > 0 pf_tag_unref(p->brl_tag); #endif - free(p, M_DEVBUF); + free(p, M_DEVBUF, 0); } while (!SIMPLEQ_EMPTY(&bif->bif_brlout)) { p = SIMPLEQ_FIRST(&bif->bif_brlout); @@ -2191,7 +2191,7 @@ bridge_flushrule(struct bridge_iflist *bif) #if NPF > 0 pf_tag_unref(p->brl_tag); #endif - free(p, M_DEVBUF); + free(p, M_DEVBUF, 0); } } diff --git a/sys/net/if_enc.c b/sys/net/if_enc.c index 083fc5ce665..6bc31ad6ce4 100644 --- a/sys/net/if_enc.c +++ b/sys/net/if_enc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_enc.c,v 1.54 2014/05/21 14:48:28 mpi Exp $ */ +/* $OpenBSD: if_enc.c,v 1.55 2014/07/12 18:44:22 tedu Exp $ */ /* * Copyright (c) 2010 Reyk Floeter @@ -110,7 +110,7 @@ enc_clone_create(struct if_clone *ifc, int unit) if ((error = enc_setif(ifp, 0)) != 0) { if_detach(ifp); - free(sc, M_DEVBUF); + free(sc, M_DEVBUF, 0); return (error); } @@ -122,7 +122,7 @@ enc_clone_create(struct if_clone *ifc, int unit) if (enc_allifps != NULL) { memcpy(new, enc_allifps, sizeof(struct ifnet *) * (enc_max_unit + 1)); - free(enc_allifps, M_DEVBUF); + free(enc_allifps, M_DEVBUF, 0); } enc_allifps = new; enc_max_unit = unit; @@ -146,7 +146,7 @@ enc_clone_destroy(struct ifnet *ifp) enc_allifps[sc->sc_unit] = NULL; enc_unsetif(ifp); if_detach(ifp); - free(sc, M_DEVBUF); + free(sc, M_DEVBUF, 0); splx(s); return (0); @@ -254,7 +254,7 @@ enc_setif(struct ifnet *ifp, u_int id) if (enc_ifps != NULL) { memcpy(new, enc_ifps, sizeof(struct ifnet *) * (enc_max_id + 1)); - free(enc_ifps, M_DEVBUF); + free(enc_ifps, M_DEVBUF, 0); } enc_ifps = new; enc_max_id = id; diff --git a/sys/net/if_ethersubr.c b/sys/net/if_ethersubr.c index 7ab15bbeef3..e37066984d1 100644 --- a/sys/net/if_ethersubr.c +++ b/sys/net/if_ethersubr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_ethersubr.c,v 1.173 2014/07/08 07:10:12 dlg Exp $ */ +/* $OpenBSD: if_ethersubr.c,v 1.174 2014/07/12 18:44:22 tedu Exp $ */ /* $NetBSD: if_ethersubr.c,v 1.19 1996/05/07 02:40:30 thorpej Exp $ */ /* @@ -816,7 +816,7 @@ ether_ifdetach(struct ifnet *ifp) enm != NULL; enm = LIST_FIRST(&ac->ac_multiaddrs)) { LIST_REMOVE(enm, enm_list); - free(enm, M_IFMADDR); + free(enm, M_IFMADDR, 0); } #if 0 @@ -1111,7 +1111,7 @@ ether_delmulti(struct ifreq *ifr, struct arpcom *ac) * No remaining claims to this record; unlink and free it. */ LIST_REMOVE(enm, enm_list); - free(enm, M_IFMADDR); + free(enm, M_IFMADDR, 0); ac->ac_multicnt--; if (memcmp(addrlo, addrhi, ETHER_ADDR_LEN) != 0) ac->ac_multirangecnt--; diff --git a/sys/net/if_gif.c b/sys/net/if_gif.c index 264e83c6325..f0082580ed9 100644 --- a/sys/net/if_gif.c +++ b/sys/net/if_gif.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_gif.c,v 1.67 2014/05/05 11:44:33 mpi Exp $ */ +/* $OpenBSD: if_gif.c,v 1.68 2014/07/12 18:44:22 tedu Exp $ */ /* $KAME: if_gif.c,v 1.43 2001/02/20 08:51:07 itojun Exp $ */ /* @@ -135,12 +135,12 @@ gif_clone_destroy(struct ifnet *ifp) if_detach(ifp); if (sc->gif_psrc) - free((caddr_t)sc->gif_psrc, M_IFADDR); + free((caddr_t)sc->gif_psrc, M_IFADDR, 0); sc->gif_psrc = NULL; if (sc->gif_pdst) - free((caddr_t)sc->gif_pdst, M_IFADDR); + free((caddr_t)sc->gif_pdst, M_IFADDR, 0); sc->gif_pdst = NULL; - free(sc, M_DEVBUF); + free(sc, M_DEVBUF, 0); return (0); } @@ -500,13 +500,13 @@ gif_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) } if (sc->gif_psrc) - free((caddr_t)sc->gif_psrc, M_IFADDR); + free((caddr_t)sc->gif_psrc, M_IFADDR, 0); sa = malloc(src->sa_len, M_IFADDR, M_WAITOK); bcopy((caddr_t)src, (caddr_t)sa, src->sa_len); sc->gif_psrc = sa; if (sc->gif_pdst) - free((caddr_t)sc->gif_pdst, M_IFADDR); + free((caddr_t)sc->gif_pdst, M_IFADDR, 0); sa = malloc(dst->sa_len, M_IFADDR, M_WAITOK); bcopy((caddr_t)dst, (caddr_t)sa, dst->sa_len); sc->gif_pdst = sa; @@ -522,11 +522,11 @@ gif_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) #ifdef SIOCDIFPHYADDR case SIOCDIFPHYADDR: if (sc->gif_psrc) { - free((caddr_t)sc->gif_psrc, M_IFADDR); + free((caddr_t)sc->gif_psrc, M_IFADDR, 0); sc->gif_psrc = NULL; } if (sc->gif_pdst) { - free((caddr_t)sc->gif_pdst, M_IFADDR); + free((caddr_t)sc->gif_pdst, M_IFADDR, 0); sc->gif_pdst = NULL; } /* change the IFF_{UP, RUNNING} flag as well? */ diff --git a/sys/net/if_gre.c b/sys/net/if_gre.c index 3e58bc1ef08..9fc289dcf1a 100644 --- a/sys/net/if_gre.c +++ b/sys/net/if_gre.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_gre.c,v 1.68 2014/05/05 11:44:33 mpi Exp $ */ +/* $OpenBSD: if_gre.c,v 1.69 2014/07/12 18:44:22 tedu Exp $ */ /* $NetBSD: if_gre.c,v 1.9 1999/10/25 19:18:11 drochner Exp $ */ /* @@ -178,7 +178,7 @@ gre_clone_destroy(struct ifnet *ifp) if_detach(ifp); - free(sc, M_DEVBUF); + free(sc, M_DEVBUF, 0); return (0); } diff --git a/sys/net/if_loop.c b/sys/net/if_loop.c index c6307e1df00..75af9049426 100644 --- a/sys/net/if_loop.c +++ b/sys/net/if_loop.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_loop.c,v 1.55 2014/05/14 19:08:33 claudio Exp $ */ +/* $OpenBSD: if_loop.c,v 1.56 2014/07/12 18:44:22 tedu Exp $ */ /* $NetBSD: if_loop.c,v 1.15 1996/05/07 02:40:33 thorpej Exp $ */ /* @@ -199,7 +199,7 @@ loop_clone_destroy(struct ifnet *ifp) if_detach(ifp); - free(ifp, M_DEVBUF); + free(ifp, M_DEVBUF, 0); return (0); } diff --git a/sys/net/if_media.c b/sys/net/if_media.c index b601952a1d9..9755591cdeb 100644 --- a/sys/net/if_media.c +++ b/sys/net/if_media.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_media.c,v 1.22 2014/01/19 13:47:03 pelikan Exp $ */ +/* $OpenBSD: if_media.c,v 1.23 2014/07/12 18:44:22 tedu Exp $ */ /* $NetBSD: if_media.c,v 1.10 2000/03/13 23:52:39 soren Exp $ */ /*- @@ -327,7 +327,7 @@ ifmedia_ioctl(struct ifnet *ifp, struct ifreq *ifr, struct ifmedia *ifm, nwords * sizeof(int)); else error = E2BIG; - free(kptr, M_TEMP); + free(kptr, M_TEMP, 0); } ifmr->ifm_count = nwords; break; @@ -380,7 +380,7 @@ ifmedia_delete_instance(struct ifmedia *ifm, u_int inst) if (inst == IFM_INST_ANY || inst == IFM_INST(ife->ifm_media)) { TAILQ_REMOVE(&ifm->ifm_list, ife, ifm_list); - free(ife, M_IFADDR); + free(ife, M_IFADDR, 0); } } } diff --git a/sys/net/if_mpe.c b/sys/net/if_mpe.c index bce4c49dd76..0c708de75cd 100644 --- a/sys/net/if_mpe.c +++ b/sys/net/if_mpe.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_mpe.c,v 1.33 2014/04/14 09:06:42 mpi Exp $ */ +/* $OpenBSD: if_mpe.c,v 1.34 2014/07/12 18:44:22 tedu Exp $ */ /* * Copyright (c) 2008 Pierre-Yves Ritschard @@ -129,7 +129,7 @@ mpe_clone_destroy(struct ifnet *ifp) splx(s); if_detach(ifp); - free(mpeif, M_DEVBUF); + free(mpeif, M_DEVBUF, 0); return (0); } diff --git a/sys/net/if_pflog.c b/sys/net/if_pflog.c index 104f27ebfa7..7a597e8fa5e 100644 --- a/sys/net/if_pflog.c +++ b/sys/net/if_pflog.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_pflog.c,v 1.60 2014/07/09 11:03:04 henning Exp $ */ +/* $OpenBSD: if_pflog.c,v 1.61 2014/07/12 18:44:22 tedu Exp $ */ /* * The authors of this code are John Ioannidis (ji@tla.org), * Angelos D. Keromytis (kermit@csd.uch.gr) and @@ -129,7 +129,7 @@ pflogifs_resize(size_t n) p[i] = NULL; if (pflogifs) - free(pflogifs, M_DEVBUF); + free(pflogifs, M_DEVBUF, 0); pflogifs = p; npflogifs = n; return (0); @@ -193,7 +193,7 @@ pflog_clone_destroy(struct ifnet *ifp) splx(s); if_detach(ifp); - free(pflogif, M_DEVBUF); + free(pflogif, M_DEVBUF, 0); return (0); } diff --git a/sys/net/if_pflow.c b/sys/net/if_pflow.c index 393316aeda6..b3ad4befd14 100644 --- a/sys/net/if_pflow.c +++ b/sys/net/if_pflow.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_pflow.c,v 1.43 2014/04/21 12:22:25 henning Exp $ */ +/* $OpenBSD: if_pflow.c,v 1.44 2014/07/12 18:44:22 tedu Exp $ */ /* * Copyright (c) 2011 Florian Obser @@ -271,8 +271,8 @@ pflow_clone_destroy(struct ifnet *ifp) pflow_flush(sc); if_detach(ifp); SLIST_REMOVE(&pflowif_list, sc, pflow_softc, sc_next); - 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); splx(s); return (0); } diff --git a/sys/net/if_pfsync.c b/sys/net/if_pfsync.c index 0d11d5ab067..365b81c782d 100644 --- a/sys/net/if_pfsync.c +++ b/sys/net/if_pfsync.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_pfsync.c,v 1.206 2014/04/21 12:22:25 henning Exp $ */ +/* $OpenBSD: if_pfsync.c,v 1.207 2014/07/12 18:44:22 tedu Exp $ */ /* * Copyright (c) 2002 Michael Shalayeff @@ -381,8 +381,8 @@ pfsync_clone_destroy(struct ifnet *ifp) } pool_destroy(&sc->sc_pool); - 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); pfsyncif = NULL; splx(s); diff --git a/sys/net/if_ppp.c b/sys/net/if_ppp.c index 5cb44e75ac4..cff0149e64b 100644 --- a/sys/net/if_ppp.c +++ b/sys/net/if_ppp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_ppp.c,v 1.74 2014/05/05 11:44:33 mpi Exp $ */ +/* $OpenBSD: if_ppp.c,v 1.75 2014/07/12 18:44:22 tedu Exp $ */ /* $NetBSD: if_ppp.c,v 1.39 1997/05/17 21:11:59 christos Exp $ */ /* @@ -274,7 +274,7 @@ ppp_clone_destroy(struct ifnet *ifp) if_detach(ifp); - free(sc, M_DEVBUF); + free(sc, M_DEVBUF, 0); return (0); } @@ -367,19 +367,19 @@ pppdealloc(struct ppp_softc *sc) #endif /* PPP_COMPRESS */ #if NBPFILTER > 0 if (sc->sc_pass_filt.bf_insns != 0) { - free(sc->sc_pass_filt.bf_insns, M_DEVBUF); + free(sc->sc_pass_filt.bf_insns, M_DEVBUF, 0); sc->sc_pass_filt.bf_insns = 0; sc->sc_pass_filt.bf_len = 0; } if (sc->sc_active_filt.bf_insns != 0) { - free(sc->sc_active_filt.bf_insns, M_DEVBUF); + free(sc->sc_active_filt.bf_insns, M_DEVBUF, 0); sc->sc_active_filt.bf_insns = 0; sc->sc_active_filt.bf_len = 0; } #endif #ifdef VJC if (sc->sc_comp != 0) { - free(sc->sc_comp, M_DEVBUF); + free(sc->sc_comp, M_DEVBUF, 0); sc->sc_comp = 0; } #endif @@ -569,11 +569,11 @@ pppioctl(struct ppp_softc *sc, u_long cmd, caddr_t data, int flag, newcode = malloc(newcodelen, M_DEVBUF, M_WAITOK); if ((error = copyin((caddr_t)nbp->bf_insns, (caddr_t)newcode, newcodelen)) != 0) { - free(newcode, M_DEVBUF); + free(newcode, M_DEVBUF, 0); return error; } if (!bpf_validate(newcode, nbp->bf_len)) { - free(newcode, M_DEVBUF); + free(newcode, M_DEVBUF, 0); return EINVAL; } } else @@ -585,7 +585,7 @@ pppioctl(struct ppp_softc *sc, u_long cmd, caddr_t data, int flag, bp->bf_insns = newcode; splx(s); if (oldcode != 0) - free(oldcode, M_DEVBUF); + free(oldcode, M_DEVBUF, 0); break; #endif diff --git a/sys/net/if_pppoe.c b/sys/net/if_pppoe.c index da5341d5256..efa97fe3d85 100644 --- a/sys/net/if_pppoe.c +++ b/sys/net/if_pppoe.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_pppoe.c,v 1.39 2014/06/07 11:04:14 henning Exp $ */ +/* $OpenBSD: if_pppoe.c,v 1.40 2014/07/12 18:44:22 tedu Exp $ */ /* $NetBSD: if_pppoe.c,v 1.51 2003/11/28 08:56:48 keihan Exp $ */ /* @@ -280,15 +280,15 @@ pppoe_clone_destroy(struct ifnet *ifp) if_detach(ifp); if (sc->sc_concentrator_name) - free(sc->sc_concentrator_name, M_DEVBUF); + free(sc->sc_concentrator_name, M_DEVBUF, 0); if (sc->sc_service_name) - free(sc->sc_service_name, M_DEVBUF); + free(sc->sc_service_name, M_DEVBUF, 0); if (sc->sc_ac_cookie) - free(sc->sc_ac_cookie, M_DEVBUF); + free(sc->sc_ac_cookie, M_DEVBUF, 0); if (sc->sc_relay_sid) - free(sc->sc_relay_sid, M_DEVBUF); + free(sc->sc_relay_sid, M_DEVBUF, 0); - free(sc, M_DEVBUF); + free(sc, M_DEVBUF, 0); return (0); } @@ -600,7 +600,7 @@ breakbreak: } if (hunique) { if (sc->sc_hunique) - free(sc->sc_hunique, M_DEVBUF); + free(sc->sc_hunique, M_DEVBUF, 0); sc->sc_hunique = malloc(hunique_len, M_DEVBUF, M_DONTWAIT); if (sc->sc_hunique == NULL) @@ -642,7 +642,7 @@ breakbreak: } if (hunique) { if (sc->sc_hunique) - free(sc->sc_hunique, M_DEVBUF); + free(sc->sc_hunique, M_DEVBUF, 0); sc->sc_hunique = malloc(hunique_len, M_DEVBUF, M_DONTWAIT); if (sc->sc_hunique == NULL) @@ -674,7 +674,7 @@ breakbreak: } if (ac_cookie) { if (sc->sc_ac_cookie) - free(sc->sc_ac_cookie, M_DEVBUF); + free(sc->sc_ac_cookie, M_DEVBUF, 0); sc->sc_ac_cookie = malloc(ac_cookie_len, M_DEVBUF, M_DONTWAIT); if (sc->sc_ac_cookie == NULL) @@ -684,7 +684,7 @@ breakbreak: } if (relay_sid) { if (sc->sc_relay_sid) - free(sc->sc_relay_sid, M_DEVBUF); + free(sc->sc_relay_sid, M_DEVBUF, 0); sc->sc_relay_sid = malloc(relay_sid_len, M_DEVBUF, M_DONTWAIT); if (sc->sc_relay_sid == NULL) @@ -737,11 +737,11 @@ breakbreak: sc->sc_state = PPPOE_STATE_INITIAL; memcpy(&sc->sc_dest, etherbroadcastaddr, sizeof(sc->sc_dest)); if (sc->sc_ac_cookie) { - free(sc->sc_ac_cookie, M_DEVBUF); + free(sc->sc_ac_cookie, M_DEVBUF, 0); sc->sc_ac_cookie = NULL; } if (sc->sc_relay_sid) { - free(sc->sc_relay_sid, M_DEVBUF); + free(sc->sc_relay_sid, M_DEVBUF, 0); sc->sc_relay_sid = NULL; } sc->sc_ac_cookie_len = 0; @@ -938,7 +938,7 @@ pppoe_ioctl(struct ifnet *ifp, unsigned long cmd, caddr_t data) } if (sc->sc_concentrator_name) - free(sc->sc_concentrator_name, M_DEVBUF); + free(sc->sc_concentrator_name, M_DEVBUF, 0); sc->sc_concentrator_name = NULL; len = strlen(parms->ac_name); @@ -951,7 +951,7 @@ pppoe_ioctl(struct ifnet *ifp, unsigned long cmd, caddr_t data) } if (sc->sc_service_name) - free(sc->sc_service_name, M_DEVBUF); + free(sc->sc_service_name, M_DEVBUF, 0); sc->sc_service_name = NULL; len = strlen(parms->service_name); @@ -1263,18 +1263,18 @@ pppoe_disconnect(struct pppoe_softc *sc) sc->sc_state = PPPOE_STATE_INITIAL; memcpy(&sc->sc_dest, etherbroadcastaddr, sizeof(sc->sc_dest)); if (sc->sc_ac_cookie) { - free(sc->sc_ac_cookie, M_DEVBUF); + free(sc->sc_ac_cookie, M_DEVBUF, 0); sc->sc_ac_cookie = NULL; } sc->sc_ac_cookie_len = 0; if (sc->sc_relay_sid) { - free(sc->sc_relay_sid, M_DEVBUF); + free(sc->sc_relay_sid, M_DEVBUF, 0); sc->sc_relay_sid = NULL; } sc->sc_relay_sid_len = 0; #ifdef PPPOE_SERVER if (sc->sc_hunique) { - free(sc->sc_hunique, M_DEVBUF); + free(sc->sc_hunique, M_DEVBUF, 0); sc->sc_hunique = NULL; } sc->sc_hunique_len = 0; diff --git a/sys/net/if_pppx.c b/sys/net/if_pppx.c index 66b2a836043..3e71ec6b54f 100644 --- a/sys/net/if_pppx.c +++ b/sys/net/if_pppx.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_pppx.c,v 1.30 2014/05/05 11:44:33 mpi Exp $ */ +/* $OpenBSD: if_pppx.c,v 1.31 2014/07/12 18:44:22 tedu Exp $ */ /* * Copyright (c) 2010 Claudio Jeker @@ -603,11 +603,11 @@ pppxclose(dev_t dev, int flags, int mode, struct proc *p) IF_PURGE(&pxd->pxd_svcq); splx(s); - free(pxd, M_DEVBUF); + free(pxd, M_DEVBUF, 0); if (LIST_EMPTY(&pppx_devs)) { pool_destroy(pppx_if_pl); - free(pppx_if_pl, M_DEVBUF); + free(pppx_if_pl, M_DEVBUF, 0); pppx_if_pl = NULL; } @@ -660,7 +660,7 @@ pppx_if_find(struct pppx_dev *pxd, int session_id, int protocol) p = RB_FIND(pppx_ifs, &pppx_ifs, s); rw_exit_read(&pppx_ifs_lk); - free(s, M_DEVBUF); + free(s, M_DEVBUF, 0); return (p); } diff --git a/sys/net/if_sl.c b/sys/net/if_sl.c index 48a743ca31d..052124f49aa 100644 --- a/sys/net/if_sl.c +++ b/sys/net/if_sl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_sl.c,v 1.51 2014/04/14 09:06:42 mpi Exp $ */ +/* $OpenBSD: if_sl.c,v 1.52 2014/07/12 18:44:22 tedu Exp $ */ /* $NetBSD: if_sl.c,v 1.39.4.1 1996/06/02 16:26:31 thorpej Exp $ */ /* @@ -243,7 +243,7 @@ sl_clone_destroy(ifp) if_detach(ifp); - free(sc, M_DEVBUF); + free(sc, M_DEVBUF, 0); return (0); } diff --git a/sys/net/if_spppsubr.c b/sys/net/if_spppsubr.c index afbced7c8c7..d3ff56ac9a8 100644 --- a/sys/net/if_spppsubr.c +++ b/sys/net/if_spppsubr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_spppsubr.c,v 1.123 2014/05/05 11:44:33 mpi Exp $ */ +/* $OpenBSD: if_spppsubr.c,v 1.124 2014/07/12 18:44:22 tedu Exp $ */ /* * Synchronous PPP/Cisco link level subroutines. * Keepalive protocol implemented in both Cisco and PPP modes. @@ -906,13 +906,13 @@ sppp_detach(struct ifnet *ifp) /* release authentication data */ if (sp->myauth.name != NULL) - free(sp->myauth.name, M_DEVBUF); + free(sp->myauth.name, M_DEVBUF, 0); if (sp->myauth.secret != NULL) - free(sp->myauth.secret, M_DEVBUF); + free(sp->myauth.secret, M_DEVBUF, 0); if (sp->hisauth.name != NULL) - free(sp->hisauth.name, M_DEVBUF); + free(sp->hisauth.name, M_DEVBUF, 0); if (sp->hisauth.secret != NULL) - free(sp->hisauth.secret, M_DEVBUF); + free(sp->hisauth.secret, M_DEVBUF, 0); } /* @@ -2115,7 +2115,7 @@ sppp_lcp_RCR(struct sppp *sp, struct lcp_header *h, int len) p = (void*) (h+1); for (rlen = 0; len > 1; len -= p[1], p += p[1]) { if (p[1] < 2 || p[1] > len) { - free(buf, M_TEMP); + free(buf, M_TEMP, 0); return (-1); } if (debug) @@ -2292,7 +2292,7 @@ sppp_lcp_RCR(struct sppp *sp, struct lcp_header *h, int len) } end: - free(buf, M_TEMP); + free(buf, M_TEMP, 0); return (rlen == 0); } @@ -2698,7 +2698,7 @@ sppp_ipcp_RCR(struct sppp *sp, struct lcp_header *h, int len) p = (void*) (h+1); for (rlen = 0; len > 1; len -= p[1], p += p[1]) { if (p[1] < 2 || p[1] > len) { - free(buf, M_TEMP); + free(buf, M_TEMP, 0); return (-1); } if (debug) @@ -2842,7 +2842,7 @@ sppp_ipcp_RCR(struct sppp *sp, struct lcp_header *h, int len) } end: - free(buf, M_TEMP); + free(buf, M_TEMP, 0); return (rlen == 0); } @@ -3166,7 +3166,7 @@ sppp_ipv6cp_RCR(struct sppp *sp, struct lcp_header *h, int len) for (rlen=0; len>1 && p[1]; len-=p[1], p+=p[1]) { /* Sanity check option length */ if (p[1] < 2 || p[1] > len) { - free(buf, M_TEMP); + free(buf, M_TEMP, 0); return (-1); } if (debug) @@ -3300,7 +3300,7 @@ sppp_ipv6cp_RCR(struct sppp *sp, struct lcp_header *h, int len) } end: - free(buf, M_TEMP); + free(buf, M_TEMP, 0); return (rlen == 0); } @@ -4880,10 +4880,10 @@ sppp_get_params(struct sppp *sp, struct ifreq *ifr) spr->phase = sp->pp_phase; if (copyout(spr, (caddr_t)ifr->ifr_data, sizeof(*spr)) != 0) { - free(spr, M_DEVBUF); + free(spr, M_DEVBUF, 0); return EFAULT; } - free(spr, M_DEVBUF); + free(spr, M_DEVBUF, 0); break; } case SPPPIOGMAUTH: @@ -4903,10 +4903,10 @@ sppp_get_params(struct sppp *sp, struct ifreq *ifr) strlcpy(spa->name, auth->name, sizeof(spa->name)); if (copyout(spa, (caddr_t)ifr->ifr_data, sizeof(*spa)) != 0) { - free(spa, M_DEVBUF); + free(spa, M_DEVBUF, 0); return EFAULT; } - free(spa, M_DEVBUF); + free(spa, M_DEVBUF, 0); break; } default: @@ -4946,7 +4946,7 @@ sppp_set_params(struct sppp *sp, struct ifreq *ifr) spr = malloc(sizeof(*spr), M_DEVBUF, M_WAITOK); if (copyin((caddr_t)ifr->ifr_data, spr, sizeof(*spr)) != 0) { - free(spr, M_DEVBUF); + free(spr, M_DEVBUF, 0); return EFAULT; } /* @@ -4955,7 +4955,7 @@ sppp_set_params(struct sppp *sp, struct ifreq *ifr) * * XXX Should allow to set or clear pp_flags. */ - free(spr, M_DEVBUF); + free(spr, M_DEVBUF, 0); break; } case SPPPIOSMAUTH: @@ -4982,22 +4982,22 @@ sppp_set_params(struct sppp *sp, struct ifreq *ifr) auth = (cmd == SPPPIOSMAUTH) ? &sp->myauth : &sp->hisauth; if (copyin((caddr_t)ifr->ifr_data, spa, sizeof(*spa)) != 0) { - free(spa, M_DEVBUF); + free(spa, M_DEVBUF, 0); return EFAULT; } if (spa->proto != 0 && spa->proto != PPP_PAP && spa->proto != PPP_CHAP) { - free(spa, M_DEVBUF); + free(spa, M_DEVBUF, 0); return EINVAL; } if (spa->proto == 0) { /* resetting auth */ if (auth->name != NULL) - free(auth->name, M_DEVBUF); + free(auth->name, M_DEVBUF, 0); if (auth->secret != NULL) - free(auth->secret, M_DEVBUF); + free(auth->secret, M_DEVBUF, 0); bzero(auth, sizeof *auth); explicit_bzero(sp->chap_challenge, sizeof sp->chap_challenge); } else { @@ -5010,7 +5010,7 @@ sppp_set_params(struct sppp *sp, struct ifreq *ifr) p = malloc(len, M_DEVBUF, M_WAITOK); strlcpy(p, spa->name, len); if (auth->name != NULL) - free(auth->name, M_DEVBUF); + free(auth->name, M_DEVBUF, 0); auth->name = p; if (spa->secret[0] != '\0') { @@ -5019,7 +5019,7 @@ sppp_set_params(struct sppp *sp, struct ifreq *ifr) p = malloc(len, M_DEVBUF, M_WAITOK); strlcpy(p, spa->secret, len); if (auth->secret != NULL) - free(auth->secret, M_DEVBUF); + free(auth->secret, M_DEVBUF, 0); auth->secret = p; } else if (!auth->secret) { p = malloc(1, M_DEVBUF, M_WAITOK); @@ -5027,7 +5027,7 @@ sppp_set_params(struct sppp *sp, struct ifreq *ifr) auth->secret = p; } } - free(spa, M_DEVBUF); + free(spa, M_DEVBUF, 0); break; } default: diff --git a/sys/net/if_trunk.c b/sys/net/if_trunk.c index 67128e53464..aadf2d7bd28 100644 --- a/sys/net/if_trunk.c +++ b/sys/net/if_trunk.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_trunk.c,v 1.88 2014/07/09 09:30:49 henning Exp $ */ +/* $OpenBSD: if_trunk.c,v 1.89 2014/07/12 18:44:22 tedu Exp $ */ /* * Copyright (c) 2005, 2006, 2007 Reyk Floeter @@ -169,7 +169,7 @@ trunk_clone_create(struct if_clone *ifc, int unit) if (trunk_protos[i].ti_proto == TRUNK_PROTO_DEFAULT) { tr->tr_proto = trunk_protos[i].ti_proto; if ((error = trunk_protos[i].ti_attach(tr)) != 0) { - free(tr, M_DEVBUF); + free(tr, M_DEVBUF, 0); return (error); } break; @@ -235,7 +235,7 @@ trunk_clone_destroy(struct ifnet *ifp) if_detach(ifp); SLIST_REMOVE(&trunk_list, tr, trunk_softc, tr_entries); - free(tr, M_DEVBUF); + free(tr, M_DEVBUF, 0); splx(s); @@ -337,7 +337,7 @@ trunk_port_create(struct trunk_softc *tr, struct ifnet *ifp) tp->tp_flags |= TRUNK_PORT_STACK; if (trunk_port_checkstacking(tr_ptr) >= TRUNK_MAX_STACKING) { - free(tp, M_DEVBUF); + free(tp, M_DEVBUF, 0); return (E2BIG); } } @@ -463,7 +463,7 @@ trunk_port_destroy(struct trunk_port *tp) /* Reset the port lladdr */ trunk_port_lladdr(tp, tp->tp_lladdr); - free(tp, M_DEVBUF); + free(tp, M_DEVBUF, 0); /* Update trunk capabilities */ tr->tr_capabilities = trunk_capabilities(tr); @@ -841,7 +841,7 @@ trunk_ether_delmulti(struct trunk_softc *tr, struct ifreq *ifr) } SLIST_REMOVE(&tr->tr_mc_head, mc, trunk_mc, mc_entries); - free(mc, M_DEVBUF); + free(mc, M_DEVBUF, 0); return (0); } @@ -860,7 +860,7 @@ trunk_ether_purgemulti(struct trunk_softc *tr) trunk_ioctl_allports(tr, SIOCDELMULTI, (caddr_t)ifr); SLIST_REMOVE(&tr->tr_mc_head, mc, trunk_mc, mc_entries); - free(mc, M_DEVBUF); + free(mc, M_DEVBUF, 0); } } @@ -1414,7 +1414,7 @@ trunk_lb_detach(struct trunk_softc *tr) { struct trunk_lb *lb = (struct trunk_lb *)tr->tr_psc; if (lb != NULL) - free(lb, M_DEVBUF); + free(lb, M_DEVBUF, 0); return (0); } diff --git a/sys/net/if_tun.c b/sys/net/if_tun.c index 7d705463df4..9f62d5b8314 100644 --- a/sys/net/if_tun.c +++ b/sys/net/if_tun.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_tun.c,v 1.125 2014/05/05 11:44:33 mpi Exp $ */ +/* $OpenBSD: if_tun.c,v 1.126 2014/07/12 18:44:22 tedu Exp $ */ /* $NetBSD: if_tun.c,v 1.24 1996/05/07 02:40:48 thorpej Exp $ */ /* @@ -246,7 +246,7 @@ tun_clone_destroy(struct ifnet *ifp) if_detach(ifp); - free(tp, M_DEVBUF); + free(tp, M_DEVBUF, 0); return (0); } @@ -322,7 +322,7 @@ tun_switch(struct tun_softc *tp, int flags) } abort: if (ifgrpnames) - free(ifgrpnames, M_TEMP); + free(ifgrpnames, M_TEMP, 0); return (r); } diff --git a/sys/net/if_vether.c b/sys/net/if_vether.c index 7b1b5b6e561..c2d4cd02996 100644 --- a/sys/net/if_vether.c +++ b/sys/net/if_vether.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_vether.c,v 1.19 2013/10/19 14:46:31 mpi Exp $ */ +/* $OpenBSD: if_vether.c,v 1.20 2014/07/12 18:44:22 tedu Exp $ */ /* * Copyright (c) 2009 Theo de Raadt @@ -108,7 +108,7 @@ vether_clone_destroy(struct ifnet *ifp) ifmedia_delete_instance(&sc->sc_media, IFM_INST_ANY); ether_ifdetach(ifp); if_detach(ifp); - free(sc, M_DEVBUF); + free(sc, M_DEVBUF, 0); return (0); } diff --git a/sys/net/if_vlan.c b/sys/net/if_vlan.c index 15a03d8a134..a5779f26f10 100644 --- a/sys/net/if_vlan.c +++ b/sys/net/if_vlan.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_vlan.c,v 1.107 2014/07/11 10:48:50 henning Exp $ */ +/* $OpenBSD: if_vlan.c,v 1.108 2014/07/12 18:44:22 tedu Exp $ */ /* * Copyright 1998 Massachusetts Institute of Technology @@ -164,7 +164,7 @@ vlan_clone_destroy(struct ifnet *ifp) vlan_unconfig(ifp, NULL); ether_ifdetach(ifp); if_detach(ifp); - free(ifv, M_DEVBUF); + free(ifv, M_DEVBUF, 0); return (0); } @@ -649,7 +649,7 @@ vlan_ether_addmulti(struct ifvlan *ifv, 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 *)&ifv->ifv_ac); @@ -690,7 +690,7 @@ vlan_ether_delmulti(struct ifvlan *ifv, struct ifreq *ifr) if ((error = (*ifp->if_ioctl)(ifp, SIOCDELMULTI, (caddr_t)ifr)) != 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 *)&ifv->ifv_ac); return (error); @@ -719,7 +719,7 @@ vlan_ether_purgemulti(struct ifvlan *ifv) 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/net/if_vxlan.c b/sys/net/if_vxlan.c index ee357be4d9c..5adc84b5d31 100644 --- a/sys/net/if_vxlan.c +++ b/sys/net/if_vxlan.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_vxlan.c,v 1.13 2014/04/21 12:22:25 henning Exp $ */ +/* $OpenBSD: if_vxlan.c,v 1.14 2014/07/12 18:44:22 tedu Exp $ */ /* * Copyright (c) 2013 Reyk Floeter @@ -168,8 +168,8 @@ vxlan_clone_destroy(struct ifnet *ifp) ifmedia_delete_instance(&sc->sc_media, IFM_INST_ANY); ether_ifdetach(ifp); if_detach(ifp); - 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); } diff --git a/sys/net/pf_if.c b/sys/net/pf_if.c index 4fc1fb50c09..638cccf715f 100644 --- a/sys/net/pf_if.c +++ b/sys/net/pf_if.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pf_if.c,v 1.72 2014/01/22 04:33:34 henning Exp $ */ +/* $OpenBSD: pf_if.c,v 1.73 2014/07/12 18:44:22 tedu Exp $ */ /* * Copyright 2005 Henning Brauer @@ -190,7 +190,7 @@ pfi_kif_unref(struct pfi_kif *kif, enum pfi_kif_refs what) return; RB_REMOVE(pfi_ifhead, &pfi_ifs, kif); - free(kif, PFI_MTYPE); + free(kif, PFI_MTYPE, 0); } int @@ -563,7 +563,7 @@ pfi_address_add(struct sockaddr *sa, int af, int net) } memcpy(p, pfi_buffer, pfi_buffer_max * sizeof(*pfi_buffer)); /* no need to zero buffer */ - free(pfi_buffer, PFI_MTYPE); + free(pfi_buffer, PFI_MTYPE, 0); pfi_buffer = p; pfi_buffer_max = new_max; } diff --git a/sys/net/pf_ioctl.c b/sys/net/pf_ioctl.c index 5ad762c1f18..56330d994eb 100644 --- a/sys/net/pf_ioctl.c +++ b/sys/net/pf_ioctl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pf_ioctl.c,v 1.272 2014/04/22 14:41:03 mpi Exp $ */ +/* $OpenBSD: pf_ioctl.c,v 1.273 2014/07/12 18:44:22 tedu Exp $ */ /* * Copyright (c) 2001 Daniel Hartmeier @@ -399,7 +399,7 @@ tag_unref(struct pf_tags *head, u_int16_t tag) if (tag == p->tag) { if (--p->ref == 0) { TAILQ_REMOVE(head, p, entries); - free(p, M_TEMP); + free(p, M_TEMP, 0); } break; } @@ -729,7 +729,7 @@ pf_commit_rules(u_int32_t ticket, char *anchor) while ((rule = TAILQ_FIRST(old_rules)) != NULL) pf_rm_rule(old_rules, rule); if (rs->rules.inactive.ptr_array) - free(rs->rules.inactive.ptr_array, M_TEMP); + free(rs->rules.inactive.ptr_array, M_TEMP, 0); rs->rules.inactive.ptr_array = NULL; rs->rules.inactive.rcount = 0; rs->rules.inactive.open = 0; @@ -751,7 +751,7 @@ pf_setup_pfsync_matching(struct pf_ruleset *rs) MD5Init(&ctx); if (rs->rules.inactive.ptr_array) - free(rs->rules.inactive.ptr_array, M_TEMP); + free(rs->rules.inactive.ptr_array, M_TEMP, 0); rs->rules.inactive.ptr_array = NULL; if (rs->rules.inactive.rcount) { @@ -1482,7 +1482,7 @@ pfioctl(dev_t dev, u_long cmd, caddr_t addr, int flags, struct proc *p) pf_state_export(pstore, state); error = copyout(pstore, p, sizeof(*p)); if (error) { - free(pstore, M_TEMP); + free(pstore, M_TEMP, 0); goto fail; } p++; @@ -1493,7 +1493,7 @@ pfioctl(dev_t dev, u_long cmd, caddr_t addr, int flags, struct proc *p) ps->ps_len = sizeof(struct pfsync_state) * nr; - free(pstore, M_TEMP); + free(pstore, M_TEMP, 0); break; } @@ -1948,8 +1948,8 @@ pfioctl(dev_t dev, u_long cmd, caddr_t addr, int flags, struct proc *p) bzero(&pf_trans_set, sizeof(pf_trans_set)); for (i = 0; i < io->size; i++) { if (copyin(io->array+i, ioe, sizeof(*ioe))) { - free(table, M_TEMP); - free(ioe, M_TEMP); + free(table, M_TEMP, 0); + free(ioe, M_TEMP, 0); error = EFAULT; goto fail; } @@ -1960,29 +1960,29 @@ pfioctl(dev_t dev, u_long cmd, caddr_t addr, int flags, struct proc *p) sizeof(table->pfrt_anchor)); if ((error = pfr_ina_begin(table, &ioe->ticket, NULL, 0))) { - free(table, M_TEMP); - free(ioe, M_TEMP); + free(table, M_TEMP, 0); + free(ioe, M_TEMP, 0); goto fail; } break; default: if ((error = pf_begin_rules(&ioe->ticket, ioe->anchor))) { - free(table, M_TEMP); - free(ioe, M_TEMP); + free(table, M_TEMP, 0); + free(ioe, M_TEMP, 0); goto fail; } break; } if (copyout(ioe, io->array+i, sizeof(io->array[i]))) { - free(table, M_TEMP); - free(ioe, M_TEMP); + free(table, M_TEMP, 0); + free(ioe, M_TEMP, 0); error = EFAULT; goto fail; } } - free(table, M_TEMP); - free(ioe, M_TEMP); + free(table, M_TEMP, 0); + free(ioe, M_TEMP, 0); break; } @@ -2000,8 +2000,8 @@ pfioctl(dev_t dev, u_long cmd, caddr_t addr, int flags, struct proc *p) table = malloc(sizeof(*table), M_TEMP, M_WAITOK); for (i = 0; i < io->size; i++) { if (copyin(io->array+i, ioe, sizeof(*ioe))) { - free(table, M_TEMP); - free(ioe, M_TEMP); + free(table, M_TEMP, 0); + free(ioe, M_TEMP, 0); error = EFAULT; goto fail; } @@ -2012,23 +2012,23 @@ pfioctl(dev_t dev, u_long cmd, caddr_t addr, int flags, struct proc *p) sizeof(table->pfrt_anchor)); if ((error = pfr_ina_rollback(table, ioe->ticket, NULL, 0))) { - free(table, M_TEMP); - free(ioe, M_TEMP); + free(table, M_TEMP, 0); + free(ioe, M_TEMP, 0); goto fail; /* really bad */ } break; default: if ((error = pf_rollback_rules(ioe->ticket, ioe->anchor))) { - free(table, M_TEMP); - free(ioe, M_TEMP); + free(table, M_TEMP, 0); + free(ioe, M_TEMP, 0); goto fail; /* really bad */ } break; } } - free(table, M_TEMP); - free(ioe, M_TEMP); + free(table, M_TEMP, 0); + free(ioe, M_TEMP, 0); break; } @@ -2048,8 +2048,8 @@ pfioctl(dev_t dev, u_long cmd, caddr_t addr, int flags, struct proc *p) /* first makes sure everything will succeed */ for (i = 0; i < io->size; i++) { if (copyin(io->array+i, ioe, sizeof(*ioe))) { - free(table, M_TEMP); - free(ioe, M_TEMP); + free(table, M_TEMP, 0); + free(ioe, M_TEMP, 0); error = EFAULT; goto fail; } @@ -2058,8 +2058,8 @@ pfioctl(dev_t dev, u_long cmd, caddr_t addr, int flags, struct proc *p) rs = pf_find_ruleset(ioe->anchor); if (rs == NULL || !rs->topen || ioe->ticket != rs->tticket) { - free(table, M_TEMP); - free(ioe, M_TEMP); + free(table, M_TEMP, 0); + free(ioe, M_TEMP, 0); error = EBUSY; goto fail; } @@ -2070,8 +2070,8 @@ pfioctl(dev_t dev, u_long cmd, caddr_t addr, int flags, struct proc *p) !rs->rules.inactive.open || rs->rules.inactive.ticket != ioe->ticket) { - free(table, M_TEMP); - free(ioe, M_TEMP); + free(table, M_TEMP, 0); + free(ioe, M_TEMP, 0); error = EBUSY; goto fail; } @@ -2086,8 +2086,8 @@ pfioctl(dev_t dev, u_long cmd, caddr_t addr, int flags, struct proc *p) for (i = 0; i < PF_LIMIT_MAX; i++) { if (((struct pool *)pf_pool_limits[i].pp)->pr_nout > pf_pool_limits[i].limit_new) { - free(table, M_TEMP); - free(ioe, M_TEMP); + free(table, M_TEMP, 0); + free(ioe, M_TEMP, 0); error = EBUSY; goto fail; } @@ -2095,8 +2095,8 @@ pfioctl(dev_t dev, u_long cmd, caddr_t addr, int flags, struct proc *p) /* now do the commit - no errors should happen here */ for (i = 0; i < io->size; i++) { if (copyin(io->array+i, ioe, sizeof(*ioe))) { - free(table, M_TEMP); - free(ioe, M_TEMP); + free(table, M_TEMP, 0); + free(ioe, M_TEMP, 0); error = EFAULT; goto fail; } @@ -2107,16 +2107,16 @@ pfioctl(dev_t dev, u_long cmd, caddr_t addr, int flags, struct proc *p) sizeof(table->pfrt_anchor)); if ((error = pfr_ina_commit(table, ioe->ticket, NULL, NULL, 0))) { - free(table, M_TEMP); - free(ioe, M_TEMP); + free(table, M_TEMP, 0); + free(ioe, M_TEMP, 0); goto fail; /* really bad */ } break; default: if ((error = pf_commit_rules(ioe->ticket, ioe->anchor))) { - free(table, M_TEMP); - free(ioe, M_TEMP); + free(table, M_TEMP, 0); + free(ioe, M_TEMP, 0); goto fail; /* really bad */ } break; @@ -2127,8 +2127,8 @@ pfioctl(dev_t dev, u_long cmd, caddr_t addr, int flags, struct proc *p) pf_pool_limits[i].limit && pool_sethardlimit(pf_pool_limits[i].pp, pf_pool_limits[i].limit_new, NULL, 0) != 0) { - free(table, M_TEMP); - free(ioe, M_TEMP); + free(table, M_TEMP, 0); + free(ioe, M_TEMP, 0); error = EBUSY; goto fail; /* really bad */ } @@ -2145,8 +2145,8 @@ pfioctl(dev_t dev, u_long cmd, caddr_t addr, int flags, struct proc *p) } pfi_xcommit(); pf_trans_set_commit(); - free(table, M_TEMP); - free(ioe, M_TEMP); + free(table, M_TEMP, 0); + free(ioe, M_TEMP, 0); break; } @@ -2195,7 +2195,7 @@ pfioctl(dev_t dev, u_long cmd, caddr_t addr, int flags, struct proc *p) error = copyout(pstore, p, sizeof(*p)); if (error) { - free(pstore, M_TEMP); + free(pstore, M_TEMP, 0); goto fail; } p++; @@ -2203,7 +2203,7 @@ pfioctl(dev_t dev, u_long cmd, caddr_t addr, int flags, struct proc *p) } psn->psn_len = sizeof(struct pf_src_node) * nr; - free(pstore, M_TEMP); + free(pstore, M_TEMP, 0); break; } diff --git a/sys/net/pf_ruleset.c b/sys/net/pf_ruleset.c index 1951001fbdc..bca6acfd3b6 100644 --- a/sys/net/pf_ruleset.c +++ b/sys/net/pf_ruleset.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pf_ruleset.c,v 1.7 2012/11/15 17:44:10 deraadt Exp $ */ +/* $OpenBSD: pf_ruleset.c,v 1.8 2014/07/12 18:44:22 tedu Exp $ */ /* * Copyright (c) 2001 Daniel Hartmeier @@ -58,7 +58,7 @@ #ifdef _KERNEL #define rs_malloc(x) malloc(x, M_TEMP, M_WAITOK|M_CANFAIL|M_ZERO) -#define rs_free(x) free(x, M_TEMP) +#define rs_free(x) free(x, M_TEMP, 0) #else /* Userland equivalents so we can lend code to pfctl et al. */ diff --git a/sys/net/pf_table.c b/sys/net/pf_table.c index a58c21d02fc..7e8d1a2ce67 100644 --- a/sys/net/pf_table.c +++ b/sys/net/pf_table.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pf_table.c,v 1.101 2013/07/05 13:07:58 blambert Exp $ */ +/* $OpenBSD: pf_table.c,v 1.102 2014/07/12 18:44:22 tedu Exp $ */ /* * Copyright (c) 2002 Cedric Berger @@ -2014,9 +2014,9 @@ pfr_destroy_ktable(struct pfr_ktable *kt, int flushaddr) pfr_destroy_kentries(&addrq); } if (kt->pfrkt_ip4 != NULL) - free((caddr_t)kt->pfrkt_ip4, M_RTABLE); + free((caddr_t)kt->pfrkt_ip4, M_RTABLE, 0); if (kt->pfrkt_ip6 != NULL) - free((caddr_t)kt->pfrkt_ip6, M_RTABLE); + free((caddr_t)kt->pfrkt_ip6, M_RTABLE, 0); if (kt->pfrkt_shadow != NULL) pfr_destroy_ktable(kt->pfrkt_shadow, flushaddr); if (kt->pfrkt_rs != NULL) { diff --git a/sys/net/pfkey.c b/sys/net/pfkey.c index 98fb149b2c5..44d5a041f39 100644 --- a/sys/net/pfkey.c +++ b/sys/net/pfkey.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pfkey.c,v 1.20 2012/11/27 17:29:07 mikeb Exp $ */ +/* $OpenBSD: pfkey.c,v 1.21 2014/07/12 18:44:22 tedu Exp $ */ /* * @(#)COPYRIGHT 1.1 (NRL) 17 January 1995 @@ -218,7 +218,7 @@ pfkey_attach(struct socket *socket, struct mbuf *proto, struct proc *p) return (0); ret: - free(socket->so_pcb, M_PCB); + free(socket->so_pcb, M_PCB, 0); return (rval); } @@ -317,7 +317,7 @@ pfkey_buildprotosw(void) } if (pfkey_domain.dom_protosw) - free(pfkey_domain.dom_protosw, M_PFKEY); + free(pfkey_domain.dom_protosw, M_PFKEY, 0); pfkey_domain.dom_protosw = protosw; pfkey_domain.dom_protoswNPROTOSW = p; @@ -330,7 +330,7 @@ pfkey_buildprotosw(void) sizeof(struct protosw)); if (pfkey_domain.dom_protosw) - free(pfkey_domain.dom_protosw, M_PFKEY); + free(pfkey_domain.dom_protosw, M_PFKEY, 0); pfkey_domain.dom_protosw = protosw; pfkey_domain.dom_protoswNPROTOSW = protosw; diff --git a/sys/net/pfkeyv2.c b/sys/net/pfkeyv2.c index c6554cbd612..2eee83fe76e 100644 --- a/sys/net/pfkeyv2.c +++ b/sys/net/pfkeyv2.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pfkeyv2.c,v 1.132 2014/01/08 02:39:02 deraadt Exp $ */ +/* $OpenBSD: pfkeyv2.c,v 1.133 2014/07/12 18:44:22 tedu Exp $ */ /* * @(#)COPYRIGHT 1.1 (NRL) 17 January 1995 @@ -197,7 +197,7 @@ pfkeyv2_release(struct socket *socket) if (pfkeyv2_socket->flags & PFKEYV2_SOCKETFLAGS_PROMISC) npromisc--; - free(pfkeyv2_socket, M_PFKEY); + free(pfkeyv2_socket, M_PFKEY, 0); } return (0); @@ -345,7 +345,7 @@ pfkeyv2_sendmessage(void **headers, int mode, struct socket *socket, ret: if (buffer != NULL) { bzero(buffer, j + sizeof(struct sadb_msg)); - free(buffer, M_PFKEY); + free(buffer, M_PFKEY, 0); } return (rval); @@ -753,7 +753,7 @@ pfkeyv2_dump_walker(struct tdb *sa, void *state, int last) PFKEYV2_SENDMESSAGE_UNICAST, dump_state->socket, 0, 0, sa->tdb_rdomain); - free(buffer, M_PFKEY); + free(buffer, M_PFKEY, 0); if (rval) return (rval); } @@ -922,7 +922,7 @@ pfkeyv2_send(struct socket *socket, void *message, int len) /* Paranoid */ explicit_bzero(freeme, sizeof(struct sadb_msg) + len); - free(freeme, M_PFKEY); + free(freeme, M_PFKEY, 0); freeme = NULL; } @@ -1872,13 +1872,13 @@ ret: realret: if (freeme) - free(freeme, M_PFKEY); + free(freeme, M_PFKEY, 0); explicit_bzero(message, len); - free(message, M_PFKEY); + free(message, M_PFKEY, 0); if (sa1) - free(sa1, M_PFKEY); + free(sa1, M_PFKEY, 0); return (rval); @@ -2156,7 +2156,7 @@ pfkeyv2_acquire(struct ipsec_policy *ipo, union sockaddr_union *gw, ret: if (buffer != NULL) { bzero(buffer, i); - free(buffer, M_PFKEY); + free(buffer, M_PFKEY, 0); } return (rval); @@ -2238,7 +2238,7 @@ pfkeyv2_expire(struct tdb *sa, u_int16_t type) ret: if (buffer != NULL) { bzero(buffer, i); - free(buffer, M_PFKEY); + free(buffer, M_PFKEY, 0); } return (rval); @@ -2302,7 +2302,7 @@ pfkeyv2_sysctl_walker(struct tdb *sa, void *arg, int last) done: if (buffer) - free(buffer, M_PFKEY); + free(buffer, M_PFKEY, 0); return (error); } @@ -2515,7 +2515,7 @@ pfkeyv2_sysctl_policydumper(struct ipsec_policy *ipo, void *arg) done: if (buffer) - free(buffer, M_PFKEY); + free(buffer, M_PFKEY, 0); return (error); } diff --git a/sys/net/pfkeyv2_convert.c b/sys/net/pfkeyv2_convert.c index 47d0dc4b027..6b20cfcb8f5 100644 --- a/sys/net/pfkeyv2_convert.c +++ b/sys/net/pfkeyv2_convert.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pfkeyv2_convert.c,v 1.42 2013/10/24 11:31:43 mpi Exp $ */ +/* $OpenBSD: pfkeyv2_convert.c,v 1.43 2014/07/12 18:44:22 tedu Exp $ */ /* * The author of this code is Angelos D. Keromytis (angelos@keromytis.org) * @@ -743,7 +743,7 @@ import_auth(struct tdb *tdb, struct sadb_x_cred *sadb_auth, int dstauth) (*ipr)->ref_type = IPSP_AUTH_RSA; break; default: - free(*ipr, M_CREDENTIALS); + free(*ipr, M_CREDENTIALS, 0); *ipr = NULL; return; } @@ -781,7 +781,7 @@ import_credentials(struct tdb *tdb, struct sadb_x_cred *sadb_cred, int dstcred) (*ipr)->ref_type = IPSP_CRED_KEYNOTE; break; default: - free(*ipr, M_CREDENTIALS); + free(*ipr, M_CREDENTIALS, 0); *ipr = NULL; return; } @@ -825,7 +825,7 @@ import_identity(struct tdb *tdb, struct sadb_ident *sadb_ident, int type) (*ipr)->ref_type = IPSP_IDENTITY_CONNECTION; break; default: - free(*ipr, M_CREDENTIALS); + free(*ipr, M_CREDENTIALS, 0); *ipr = NULL; return; } diff --git a/sys/net/pipex.c b/sys/net/pipex.c index 2fec5362900..dfd5cb332c5 100644 --- a/sys/net/pipex.c +++ b/sys/net/pipex.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pipex.c,v 1.53 2014/06/13 06:47:09 yasuoka Exp $ */ +/* $OpenBSD: pipex.c,v 1.54 2014/07/12 18:44:22 tedu Exp $ */ /*- * Copyright (c) 2009 Internet Initiative Japan Inc. @@ -397,7 +397,7 @@ pipex_add_session(struct pipex_session_req *req, #ifdef PIPEX_MPPE if ((req->pr_ppp_flags & PIPEX_PPP_MPPE_ACCEPTED) != 0) { if (req->pr_mppe_recv.keylenbits <= 0) { - free(session, M_TEMP); + free(session, M_TEMP, 0); return (EINVAL); } pipex_session_init_mppe_recv(session, @@ -406,7 +406,7 @@ pipex_add_session(struct pipex_session_req *req, } if ((req->pr_ppp_flags & PIPEX_PPP_MPPE_ENABLED) != 0) { if (req->pr_mppe_send.keylenbits <= 0) { - free(session, M_TEMP); + free(session, M_TEMP, 0); return (EINVAL); } pipex_session_init_mppe_send(session, @@ -417,7 +417,7 @@ pipex_add_session(struct pipex_session_req *req, if (pipex_session_is_mppe_required(session)) { if (!pipex_session_is_mppe_enabled(session) || !pipex_session_is_mppe_accepted(session)) { - free(session, M_TEMP); + free(session, M_TEMP, 0); return (EINVAL); } } @@ -429,7 +429,7 @@ pipex_add_session(struct pipex_session_req *req, if (pipex_lookup_by_ip_address(session->ip_address.sin_addr) != NULL) { splx(s); - free(session, M_TEMP); + free(session, M_TEMP, 0); return (EADDRINUSE); } @@ -437,7 +437,7 @@ pipex_add_session(struct pipex_session_req *req, &session->ip_netmask, &pipex_rd_head4, session->ps4_rn, RTP_STATIC); if (rn == NULL) { splx(s); - free(session, M_TEMP); + free(session, M_TEMP, 0); return (ENOMEM); } } @@ -447,7 +447,7 @@ pipex_add_session(struct pipex_session_req *req, RTP_STATIC); if (rn == NULL) { splx(s); - free(session, M_TEMP); + free(session, M_TEMP, 0); return (ENOMEM); } } @@ -626,8 +626,8 @@ pipex_destroy_session(struct pipex_session *session) splx(s); if (session->mppe_recv.old_session_keys) - free(session->mppe_recv.old_session_keys, M_TEMP); - free(session, M_TEMP); + free(session->mppe_recv.old_session_keys, M_TEMP, 0); + free(session, M_TEMP, 0); return (0); } diff --git a/sys/net/ppp-deflate.c b/sys/net/ppp-deflate.c index 052e07ac3b6..b7bc690c483 100644 --- a/sys/net/ppp-deflate.c +++ b/sys/net/ppp-deflate.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ppp-deflate.c,v 1.9 2011/07/07 02:57:25 deraadt Exp $ */ +/* $OpenBSD: ppp-deflate.c,v 1.10 2014/07/12 18:44:22 tedu Exp $ */ /* $NetBSD: ppp-deflate.c,v 1.1 1996/03/15 02:28:09 paulus Exp $ */ /* @@ -140,7 +140,7 @@ zcfree(notused, ptr) void *notused; void *ptr; { - free(ptr, M_DEVBUF); + free(ptr, M_DEVBUF, 0); } /* @@ -173,7 +173,7 @@ z_comp_alloc(options, opt_len) state->strm.zfree = zcfree; if (deflateInit2(&state->strm, Z_DEFAULT_COMPRESSION, DEFLATE_METHOD_VAL, -w_size, 8, Z_DEFAULT_STRATEGY) != Z_OK) { - free(state, M_DEVBUF); + free(state, M_DEVBUF, 0); return NULL; } @@ -189,7 +189,7 @@ z_comp_free(arg) struct deflate_state *state = (struct deflate_state *) arg; deflateEnd(&state->strm); - free(state, M_DEVBUF); + free(state, M_DEVBUF, 0); } static int @@ -404,7 +404,7 @@ z_decomp_alloc(options, opt_len) state->strm.zalloc = zcalloc; state->strm.zfree = zcfree; if (inflateInit2(&state->strm, -w_size) != Z_OK) { - free(state, M_DEVBUF); + free(state, M_DEVBUF, 0); return NULL; } @@ -420,7 +420,7 @@ z_decomp_free(arg) struct deflate_state *state = (struct deflate_state *) arg; inflateEnd(&state->strm); - free(state, M_DEVBUF); + free(state, M_DEVBUF, 0); } static int diff --git a/sys/net/radix.c b/sys/net/radix.c index 76da7383fe9..c9108ab0948 100644 --- a/sys/net/radix.c +++ b/sys/net/radix.c @@ -1,4 +1,4 @@ -/* $OpenBSD: radix.c,v 1.41 2014/07/01 09:58:40 mpi Exp $ */ +/* $OpenBSD: radix.c,v 1.42 2014/07/12 18:44:22 tedu Exp $ */ /* $NetBSD: radix.c,v 1.20 2003/08/07 16:32:56 agc Exp $ */ /* @@ -441,7 +441,7 @@ rn_addmask(void *n_arg, int search, int skip) tm = rn_insert(cp, mask_rnhead, &maskduplicated, tm); if (maskduplicated) { log(LOG_ERR, "rn_addmask: mask impossibly already in tree\n"); - free(saved_tm, M_RTABLE); + free(saved_tm, M_RTABLE, 0); return (tm); } /* diff --git a/sys/net/raw_cb.c b/sys/net/raw_cb.c index 9c2ba08a610..a921071da87 100644 --- a/sys/net/raw_cb.c +++ b/sys/net/raw_cb.c @@ -1,4 +1,4 @@ -/* $OpenBSD: raw_cb.c,v 1.6 2012/01/11 23:47:06 bluhm Exp $ */ +/* $OpenBSD: raw_cb.c,v 1.7 2014/07/12 18:44:22 tedu Exp $ */ /* $NetBSD: raw_cb.c,v 1.9 1996/02/13 22:00:39 christos Exp $ */ /* @@ -102,7 +102,7 @@ raw_detach(struct rawcb *rp) m_freem(dtom(rp->rcb_laddr)); rp->rcb_laddr = 0; #endif - free((caddr_t)(rp), M_PCB); + free((caddr_t)(rp), M_PCB, 0); } /* diff --git a/sys/net/route.c b/sys/net/route.c index 4b0224ab0b4..1f8f7635b89 100644 --- a/sys/net/route.c +++ b/sys/net/route.c @@ -1,4 +1,4 @@ -/* $OpenBSD: route.c,v 1.173 2014/07/12 17:57:26 mpi Exp $ */ +/* $OpenBSD: route.c,v 1.174 2014/07/12 18:44:22 tedu Exp $ */ /* $NetBSD: route.c,v 1.14 1996/02/13 22:00:46 christos Exp $ */ /* @@ -250,14 +250,14 @@ rtable_add(u_int id) if ((p = malloc(newlen, M_RTABLE, M_NOWAIT|M_ZERO)) == NULL) return (ENOMEM); if ((q = malloc(newlen2, M_RTABLE, M_NOWAIT|M_ZERO)) == NULL) { - free(p, M_RTABLE); + free(p, M_RTABLE, 0); return (ENOMEM); } if (rt_tables) { bcopy(rt_tables, p, sizeof(void *) * (rtbl_id_max+1)); bcopy(rt_tab2dom, q, sizeof(u_int) * (rtbl_id_max+1)); - free(rt_tables, M_RTABLE); - free(rt_tab2dom, M_RTABLE); + free(rt_tables, M_RTABLE, 0); + free(rt_tab2dom, M_RTABLE, 0); } rt_tables = p; rt_tab2dom = q; @@ -412,9 +412,9 @@ rtfree(struct rtentry *rt) rtlabel_unref(rt->rt_labelid); #ifdef MPLS if (rt->rt_flags & RTF_MPLS) - free(rt->rt_llinfo, M_TEMP); + free(rt->rt_llinfo, M_TEMP, 0); #endif - free(rt_key(rt), M_RTABLE); + free(rt_key(rt), M_RTABLE, 0); pool_put(&rtentry_pool, rt); } } @@ -442,7 +442,7 @@ ifafree(struct ifaddr *ifa) if (ifa == NULL) panic("ifafree"); if (ifa->ifa_refcnt == 0) - free(ifa, M_IFADDR); + free(ifa, M_IFADDR, 0); else ifa->ifa_refcnt--; } @@ -892,7 +892,7 @@ rtrequest1(int req, struct rt_addrinfo *info, u_int8_t prio, info->rti_flags & RTF_MPATH)) { if (rt->rt_gwroute) rtfree(rt->rt_gwroute); - free(rt_key(rt), M_RTABLE); + free(rt_key(rt), M_RTABLE, 0); pool_put(&rtentry_pool, rt); senderr(EEXIST); } @@ -929,7 +929,7 @@ rtrequest1(int req, struct rt_addrinfo *info, u_int8_t prio, if (rt->rt_llinfo == NULL) { if (rt->rt_gwroute) rtfree(rt->rt_gwroute); - free(rt_key(rt), M_RTABLE); + free(rt_key(rt), M_RTABLE, 0); pool_put(&rtentry_pool, rt); senderr(ENOMEM); } @@ -999,7 +999,7 @@ rtrequest1(int req, struct rt_addrinfo *info, u_int8_t prio, rtfree(rt->rt_parent); if (rt->rt_gwroute) rtfree(rt->rt_gwroute); - free(rt_key(rt), M_RTABLE); + free(rt_key(rt), M_RTABLE, 0); pool_put(&rtentry_pool, rt); senderr(EEXIST); } @@ -1045,7 +1045,7 @@ rt_setgate(struct rtentry *rt, struct sockaddr *dst, struct sockaddr *gate, memmove(rt->rt_gateway, gate, glen); if (old) { memmove(new, dst, dlen); - free(old, M_RTABLE); + free(old, M_RTABLE, 0); } if (rt->rt_gwroute != NULL) { RTFREE(rt->rt_gwroute); @@ -1372,7 +1372,7 @@ rt_timer_queue_destroy(struct rttimer_queue *rtq) } LIST_REMOVE(rtq, rtq_link); - free(rtq, M_RTABLE); + free(rtq, M_RTABLE, 0); } unsigned long @@ -1569,7 +1569,7 @@ rtlabel_unref(u_int16_t id) if (id == p->rtl_id) { if (--p->rtl_ref == 0) { TAILQ_REMOVE(&rt_labels, p, rtl_entry); - free(p, M_TEMP); + free(p, M_TEMP, 0); } break; } diff --git a/sys/net/rtsock.c b/sys/net/rtsock.c index 3594b440369..834238dbcba 100644 --- a/sys/net/rtsock.c +++ b/sys/net/rtsock.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rtsock.c,v 1.148 2014/07/08 17:19:25 deraadt Exp $ */ +/* $OpenBSD: rtsock.c,v 1.149 2014/07/12 18:44:22 tedu Exp $ */ /* $NetBSD: rtsock.c,v 1.18 1996/03/29 00:32:10 cgd Exp $ */ /* @@ -156,7 +156,7 @@ route_usrreq(struct socket *so, int req, struct mbuf *m, struct mbuf *nam, else error = raw_attach(so, (int)(long)nam); if (error) { - free(rp, M_PCB); + free(rp, M_PCB, 0); splx(s); return (error); } @@ -718,7 +718,7 @@ report: goto flush; } memcpy(new_rtm, rtm, rtm->rtm_msglen); - free(rtm, M_RTABLE); + free(rtm, M_RTABLE, 0); rtm = new_rtm; } rt_msg2(rtm->rtm_type, RTM_VERSION, &info, (caddr_t)rtm, @@ -805,7 +805,7 @@ report: /* if gateway changed remove MPLS information */ if (rt->rt_llinfo != NULL && rt->rt_flags & RTF_MPLS) { - free(rt->rt_llinfo, M_TEMP); + free(rt->rt_llinfo, M_TEMP, 0); rt->rt_llinfo = NULL; rt->rt_flags &= ~RTF_MPLS; } @@ -863,7 +863,7 @@ flush: if (!(so->so_options & SO_USELOOPBACK)) { if (route_cb.any_count <= 1) { fail: - free(rtm, M_RTABLE); + free(rtm, M_RTABLE, 0); m_freem(m); return (error); } @@ -878,7 +878,7 @@ fail: m = NULL; } else if (m->m_pkthdr.len > rtm->rtm_msglen) m_adj(m, rtm->rtm_msglen - m->m_pkthdr.len); - free(rtm, M_RTABLE); + free(rtm, M_RTABLE, 0); } if (m) route_input(m, &route_proto, &route_src, &route_dst); @@ -1031,7 +1031,7 @@ again: rw->w_needed += len; if (rw->w_needed <= 0 && rw->w_where) { if (rw->w_tmemsize < len) { - free(rw->w_tmem, M_RTABLE); + free(rw->w_tmem, M_RTABLE, 0); rw->w_tmem = malloc(len, M_RTABLE, M_NOWAIT); if (rw->w_tmem) rw->w_tmemsize = len; @@ -1403,7 +1403,7 @@ sysctl_rtable(int *name, u_int namelen, void *where, size_t *given, void *new, return (error); } splx(s); - free(w.w_tmem, M_RTABLE); + free(w.w_tmem, M_RTABLE, 0); w.w_needed += w.w_given; if (where) { *given = w.w_where - (caddr_t)where; diff --git a/sys/net/trunklacp.c b/sys/net/trunklacp.c index b960d1fc207..c85f4b10a9b 100644 --- a/sys/net/trunklacp.c +++ b/sys/net/trunklacp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: trunklacp.c,v 1.14 2012/12/05 23:20:23 deraadt Exp $ */ +/* $OpenBSD: trunklacp.c,v 1.15 2014/07/12 18:44:22 tedu Exp $ */ /* $NetBSD: ieee8023ad_lacp.c,v 1.3 2005/12/11 12:24:54 christos Exp $ */ /* $FreeBSD:ieee8023ad_lacp.c,v 1.15 2008/03/16 19:25:30 thompsa Exp $ */ @@ -557,7 +557,7 @@ lacp_port_destroy(struct trunk_port *tp) lacp_unselect(lp); LIST_REMOVE(lp, lp_next); - free(lp, M_DEVBUF); + free(lp, M_DEVBUF, 0); } void @@ -760,7 +760,7 @@ lacp_detach(struct trunk_softc *sc) timeout_del(&lsc->lsc_transit_callout); timeout_del(&lsc->lsc_callout); - free(lsc, M_DEVBUF); + free(lsc, M_DEVBUF, 0); return (0); } @@ -1067,7 +1067,7 @@ lacp_aggregator_delref(struct lacp_softc *lsc, struct lacp_aggregator *la) TAILQ_REMOVE(&lsc->lsc_aggregators, la, la_q); - free(la, M_DEVBUF); + free(la, M_DEVBUF, 0); } /* diff --git a/sys/net80211/ieee80211_crypto.c b/sys/net80211/ieee80211_crypto.c index f6772cda9b6..fd7ac93392f 100644 --- a/sys/net80211/ieee80211_crypto.c +++ b/sys/net80211/ieee80211_crypto.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ieee80211_crypto.c,v 1.61 2013/11/21 16:16:08 mpi Exp $ */ +/* $OpenBSD: ieee80211_crypto.c,v 1.62 2014/07/12 18:44:22 tedu Exp $ */ /*- * Copyright (c) 2008 Damien Bergamini @@ -87,7 +87,7 @@ ieee80211_crypto_detach(struct ifnet *ifp) while ((pmk = TAILQ_FIRST(&ic->ic_pmksa)) != NULL) { TAILQ_REMOVE(&ic->ic_pmksa, pmk, pmk_next); explicit_bzero(pmk, sizeof(*pmk)); - free(pmk, M_DEVBUF); + free(pmk, M_DEVBUF, 0); } /* clear all group keys from memory */ diff --git a/sys/net80211/ieee80211_crypto_bip.c b/sys/net80211/ieee80211_crypto_bip.c index 7a5ea8d77a4..3b76c29972d 100644 --- a/sys/net80211/ieee80211_crypto_bip.c +++ b/sys/net80211/ieee80211_crypto_bip.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ieee80211_crypto_bip.c,v 1.4 2013/11/21 16:16:08 mpi Exp $ */ +/* $OpenBSD: ieee80211_crypto_bip.c,v 1.5 2014/07/12 18:44:22 tedu Exp $ */ /*- * Copyright (c) 2008 Damien Bergamini @@ -72,7 +72,7 @@ void ieee80211_bip_delete_key(struct ieee80211com *ic, struct ieee80211_key *k) { if (k->k_priv != NULL) - free(k->k_priv, M_DEVBUF); + free(k->k_priv, M_DEVBUF, 0); k->k_priv = NULL; } diff --git a/sys/net80211/ieee80211_crypto_ccmp.c b/sys/net80211/ieee80211_crypto_ccmp.c index d081d64c851..72c55b4bc9d 100644 --- a/sys/net80211/ieee80211_crypto_ccmp.c +++ b/sys/net80211/ieee80211_crypto_ccmp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ieee80211_crypto_ccmp.c,v 1.13 2013/11/21 16:16:08 mpi Exp $ */ +/* $OpenBSD: ieee80211_crypto_ccmp.c,v 1.14 2014/07/12 18:44:22 tedu Exp $ */ /*- * Copyright (c) 2008 Damien Bergamini @@ -70,7 +70,7 @@ void ieee80211_ccmp_delete_key(struct ieee80211com *ic, struct ieee80211_key *k) { if (k->k_priv != NULL) - free(k->k_priv, M_DEVBUF); + free(k->k_priv, M_DEVBUF, 0); k->k_priv = NULL; } diff --git a/sys/net80211/ieee80211_crypto_tkip.c b/sys/net80211/ieee80211_crypto_tkip.c index 5b260306a38..101212ad7a3 100644 --- a/sys/net80211/ieee80211_crypto_tkip.c +++ b/sys/net80211/ieee80211_crypto_tkip.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ieee80211_crypto_tkip.c,v 1.21 2013/11/21 16:16:08 mpi Exp $ */ +/* $OpenBSD: ieee80211_crypto_tkip.c,v 1.22 2014/07/12 18:44:22 tedu Exp $ */ /*- * Copyright (c) 2008 Damien Bergamini @@ -98,7 +98,7 @@ void ieee80211_tkip_delete_key(struct ieee80211com *ic, struct ieee80211_key *k) { if (k->k_priv != NULL) - free(k->k_priv, M_DEVBUF); + free(k->k_priv, M_DEVBUF, 0); k->k_priv = NULL; } diff --git a/sys/net80211/ieee80211_crypto_wep.c b/sys/net80211/ieee80211_crypto_wep.c index c27710ed7be..8ba9e93c319 100644 --- a/sys/net80211/ieee80211_crypto_wep.c +++ b/sys/net80211/ieee80211_crypto_wep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ieee80211_crypto_wep.c,v 1.9 2013/11/21 16:16:08 mpi Exp $ */ +/* $OpenBSD: ieee80211_crypto_wep.c,v 1.10 2014/07/12 18:44:22 tedu Exp $ */ /*- * Copyright (c) 2008 Damien Bergamini @@ -71,7 +71,7 @@ void ieee80211_wep_delete_key(struct ieee80211com *ic, struct ieee80211_key *k) { if (k->k_priv != NULL) - free(k->k_priv, M_DEVBUF); + free(k->k_priv, M_DEVBUF, 0); k->k_priv = NULL; } diff --git a/sys/net80211/ieee80211_input.c b/sys/net80211/ieee80211_input.c index 2a0a9c64443..6927f20f9fb 100644 --- a/sys/net80211/ieee80211_input.c +++ b/sys/net80211/ieee80211_input.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ieee80211_input.c,v 1.125 2014/07/11 08:19:40 blambert Exp $ */ +/* $OpenBSD: ieee80211_input.c,v 1.126 2014/07/12 18:44:22 tedu Exp $ */ /*- * Copyright (c) 2001 Atsushi Onoe @@ -172,7 +172,7 @@ ieee80211_input_print_task(void *arg1, void *arg2) struct ieee80211printmsg *msg = arg1; printf("%s", msg->text); - free(msg, M_DEVBUF); + free(msg, M_DEVBUF, 0); } void @@ -1330,7 +1330,7 @@ ieee80211_save_ie(const u_int8_t *frm, u_int8_t **ie) { if (*ie == NULL || (*ie)[1] != frm[1]) { if (*ie != NULL) - free(*ie, M_DEVBUF); + free(*ie, M_DEVBUF, 0); *ie = malloc(2 + frm[1], M_DEVBUF, M_NOWAIT); if (*ie == NULL) return ENOMEM; @@ -2445,7 +2445,7 @@ ieee80211_recv_addba_req(struct ieee80211com *ic, struct mbuf *m, if (ic->ic_ampdu_rx_start != NULL && ic->ic_ampdu_rx_start(ic, ni, tid) != 0) { /* driver failed to setup, rollback */ - free(ba->ba_buf, M_DEVBUF); + free(ba->ba_buf, M_DEVBUF, 0); ba->ba_buf = NULL; status = IEEE80211_STATUS_REFUSED; goto resp; @@ -2583,7 +2583,7 @@ ieee80211_recv_delba(struct ieee80211com *ic, struct mbuf *m, if (ba->ba_buf[i].m != NULL) m_freem(ba->ba_buf[i].m); /* free reordering buffer */ - free(ba->ba_buf, M_DEVBUF); + free(ba->ba_buf, M_DEVBUF, 0); ba->ba_buf = NULL; } } else { diff --git a/sys/net80211/ieee80211_node.c b/sys/net80211/ieee80211_node.c index 21f63d7e6b1..3318a718a91 100644 --- a/sys/net80211/ieee80211_node.c +++ b/sys/net80211/ieee80211_node.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ieee80211_node.c,v 1.80 2013/12/01 10:08:55 stsp Exp $ */ +/* $OpenBSD: ieee80211_node.c,v 1.81 2014/07/12 18:44:22 tedu Exp $ */ /* $NetBSD: ieee80211_node.c,v 1.14 2004/05/09 09:18:47 dyoung Exp $ */ /*- @@ -217,9 +217,9 @@ ieee80211_node_detach(struct ifnet *ifp) ieee80211_free_allnodes(ic); #ifndef IEEE80211_STA_ONLY if (ic->ic_aid_bitmap != NULL) - free(ic->ic_aid_bitmap, M_DEVBUF); + free(ic->ic_aid_bitmap, M_DEVBUF, 0); if (ic->ic_tim_bitmap != NULL) - free(ic->ic_tim_bitmap, M_DEVBUF); + free(ic->ic_tim_bitmap, M_DEVBUF, 0); timeout_del(&ic->ic_inact_timeout); timeout_del(&ic->ic_node_cache_timeout); #endif @@ -765,7 +765,7 @@ void ieee80211_node_cleanup(struct ieee80211com *ic, struct ieee80211_node *ni) { if (ni->ni_rsnie != NULL) { - free(ni->ni_rsnie, M_DEVBUF); + free(ni->ni_rsnie, M_DEVBUF, 0); ni->ni_rsnie = NULL; } } @@ -774,7 +774,7 @@ void ieee80211_node_free(struct ieee80211com *ic, struct ieee80211_node *ni) { ieee80211_node_cleanup(ic, ni); - free(ni, M_DEVBUF); + free(ni, M_DEVBUF, 0); } void @@ -1501,7 +1501,7 @@ ieee80211_node_leave_ht(struct ieee80211com *ic, struct ieee80211_node *ni) for (i = 0; i < IEEE80211_BA_MAX_WINSZ; i++) if (ba->ba_buf[i].m != NULL) m_freem(ba->ba_buf[i].m); - free(ba->ba_buf, M_DEVBUF); + free(ba->ba_buf, M_DEVBUF, 0); ba->ba_buf = NULL; } } diff --git a/sys/net80211/ieee80211_proto.c b/sys/net80211/ieee80211_proto.c index c20b4e49c03..e9cb889123c 100644 --- a/sys/net80211/ieee80211_proto.c +++ b/sys/net80211/ieee80211_proto.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ieee80211_proto.c,v 1.46 2012/01/18 14:35:56 stsp Exp $ */ +/* $OpenBSD: ieee80211_proto.c,v 1.47 2014/07/12 18:44:23 tedu Exp $ */ /* $NetBSD: ieee80211_proto.c,v 1.8 2004/04/30 23:58:20 dyoung Exp $ */ /*- @@ -660,7 +660,7 @@ ieee80211_delba_request(struct ieee80211com *ic, struct ieee80211_node *ni, if (ba->ba_buf[i].m != NULL) m_freem(ba->ba_buf[i].m); /* free reordering buffer */ - free(ba->ba_buf, M_DEVBUF); + free(ba->ba_buf, M_DEVBUF, 0); ba->ba_buf = NULL; } } 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; } diff --git a/sys/netinet6/frag6.c b/sys/netinet6/frag6.c index f27ce57ffbb..049147ae563 100644 --- a/sys/netinet6/frag6.c +++ b/sys/netinet6/frag6.c @@ -1,4 +1,4 @@ -/* $OpenBSD: frag6.c,v 1.52 2014/04/14 09:06:42 mpi Exp $ */ +/* $OpenBSD: frag6.c,v 1.53 2014/07/12 18:44:23 tedu Exp $ */ /* $KAME: frag6.c,v 1.40 2002/05/27 21:40:31 itojun Exp $ */ /* @@ -348,7 +348,7 @@ frag6_input(struct mbuf **mp, int *offp, int proto) /* dequeue the fragment. */ LIST_REMOVE(af6, ip6af_list); - free(af6, M_FTABLE); + free(af6, M_FTABLE, 0); /* adjust pointer. */ ip6err = mtod(merr, struct ip6_hdr *); @@ -393,14 +393,14 @@ frag6_input(struct mbuf **mp, int *offp, int proto) ecn0 = (ntohl(af6->ip6af_flow) >> 20) & IPTOS_ECN_MASK; if (ecn == IPTOS_ECN_CE) { if (ecn0 == IPTOS_ECN_NOTECT) { - free(ip6af, M_FTABLE); + free(ip6af, M_FTABLE, 0); goto dropfrag; } if (ecn0 != IPTOS_ECN_CE) af6->ip6af_flow |= htonl(IPTOS_ECN_CE << 20); } if (ecn == IPTOS_ECN_NOTECT && ecn0 != IPTOS_ECN_NOTECT) { - free(ip6af, M_FTABLE); + free(ip6af, M_FTABLE, 0); goto dropfrag; } @@ -429,7 +429,7 @@ frag6_input(struct mbuf **mp, int *offp, int proto) i, inet_ntop(AF_INET6, &q6->ip6q_src, ip, sizeof(ip))); #endif - free(ip6af, M_FTABLE); + free(ip6af, M_FTABLE, 0); goto flushfrags; } } @@ -443,7 +443,7 @@ frag6_input(struct mbuf **mp, int *offp, int proto) i, inet_ntop(AF_INET6, &q6->ip6q_src, ip, sizeof(ip))); #endif - free(ip6af, M_FTABLE); + free(ip6af, M_FTABLE, 0); goto flushfrags; } } @@ -494,12 +494,12 @@ frag6_input(struct mbuf **mp, int *offp, int proto) t = t->m_next; t->m_next = IP6_REASS_MBUF(af6); m_adj(t->m_next, af6->ip6af_offset); - free(af6, M_FTABLE); + free(af6, M_FTABLE, 0); } /* adjust offset to point where the original next header starts */ offset = ip6af->ip6af_offset - sizeof(struct ip6_frag); - free(ip6af, M_FTABLE); + free(ip6af, M_FTABLE, 0); ip6 = mtod(m, struct ip6_hdr *); ip6->ip6_plen = htons((u_short)next + offset - sizeof(struct ip6_hdr)); ip6->ip6_src = q6->ip6q_src; @@ -510,7 +510,7 @@ frag6_input(struct mbuf **mp, int *offp, int proto) if (frag6_deletefraghdr(m, offset) != 0) { TAILQ_REMOVE(&frag6_queue, q6, ip6q_queue); frag6_nfrags -= q6->ip6q_nfrag; - free(q6, M_FTABLE); + free(q6, M_FTABLE, 0); frag6_nfragpackets--; goto dropfrag; } @@ -525,7 +525,7 @@ frag6_input(struct mbuf **mp, int *offp, int proto) TAILQ_REMOVE(&frag6_queue, q6, ip6q_queue); frag6_nfrags -= q6->ip6q_nfrag; - free(q6, M_FTABLE); + free(q6, M_FTABLE, 0); frag6_nfragpackets--; if (m->m_flags & M_PKTHDR) { /* Isn't it always true? */ @@ -552,12 +552,12 @@ frag6_input(struct mbuf **mp, int *offp, int proto) while ((af6 = LIST_FIRST(&q6->ip6q_asfrag)) != NULL) { LIST_REMOVE(af6, ip6af_list); m_freem(IP6_REASS_MBUF(af6)); - free(af6, M_FTABLE); + free(af6, M_FTABLE, 0); } ip6stat.ip6s_fragdropped += q6->ip6q_nfrag; TAILQ_REMOVE(&frag6_queue, q6, ip6q_queue); frag6_nfrags -= q6->ip6q_nfrag; - free(q6, M_FTABLE); + free(q6, M_FTABLE, 0); frag6_nfragpackets--; dropfrag: @@ -626,11 +626,11 @@ frag6_freef(struct ip6q *q6) ICMP6_TIME_EXCEED_REASSEMBLY, 0); } else m_freem(m); - free(af6, M_FTABLE); + free(af6, M_FTABLE, 0); } TAILQ_REMOVE(&frag6_queue, q6, ip6q_queue); frag6_nfrags -= q6->ip6q_nfrag; - free(q6, M_FTABLE); + free(q6, M_FTABLE, 0); frag6_nfragpackets--; } diff --git a/sys/netinet6/in6.c b/sys/netinet6/in6.c index 200265196d3..e9670897dda 100644 --- a/sys/netinet6/in6.c +++ b/sys/netinet6/in6.c @@ -1,4 +1,4 @@ -/* $OpenBSD: in6.c,v 1.137 2014/05/15 09:05:13 mpi Exp $ */ +/* $OpenBSD: in6.c,v 1.138 2014/07/12 18:44:23 tedu Exp $ */ /* $KAME: in6.c,v 1.372 2004/06/14 08:14:21 itojun Exp $ */ /* @@ -1459,7 +1459,7 @@ in6_addmulti(struct in6_addr *maddr6, struct ifnet *ifp, int *errorp) memcpy(&ifr.ifr_addr, &in6m->in6m_sin, sizeof(in6m->in6m_sin)); *errorp = (*ifp->if_ioctl)(ifp, SIOCADDMULTI, (caddr_t)&ifr); if (*errorp) { - free(in6m, M_IPMADDR); + free(in6m, M_IPMADDR, 0); return (NULL); } @@ -1513,7 +1513,7 @@ in6_delmulti(struct in6_multi *in6m) splx(s); } - free(in6m, M_IPMADDR); + free(in6m, M_IPMADDR, 0); } } @@ -1530,7 +1530,7 @@ in6_joingroup(struct ifnet *ifp, struct in6_addr *addr, int *errorp) imm->i6mm_maddr = in6_addmulti(addr, ifp, errorp); if (!imm->i6mm_maddr) { /* *errorp is alrady set */ - free(imm, M_IPMADDR); + free(imm, M_IPMADDR, 0); return NULL; } return imm; @@ -1542,7 +1542,7 @@ in6_leavegroup(struct in6_multi_mship *imm) if (imm->i6mm_maddr) in6_delmulti(imm->i6mm_maddr); - free(imm, M_IPMADDR); + free(imm, M_IPMADDR, 0); return 0; } @@ -2169,7 +2169,7 @@ in6_domifdetach(struct ifnet *ifp, void *aux) struct in6_ifextra *ext = (struct in6_ifextra *)aux; nd6_ifdetach(ext->nd_ifinfo); - free(ext->in6_ifstat, M_IFADDR); - free(ext->icmp6_ifstat, M_IFADDR); - free(ext, M_IFADDR); + free(ext->in6_ifstat, M_IFADDR, 0); + free(ext->icmp6_ifstat, M_IFADDR, 0); + free(ext, M_IFADDR, 0); } diff --git a/sys/netinet6/ip6_mroute.c b/sys/netinet6/ip6_mroute.c index e2b66ff2af9..60128a14fee 100644 --- a/sys/netinet6/ip6_mroute.c +++ b/sys/netinet6/ip6_mroute.c @@ -497,12 +497,12 @@ ip6_mrouter_done(void) struct rtdetq *n = rte->next; m_freem(rte->m); - free(rte, M_MRTABLE); + free(rte, M_MRTABLE, 0); rte = n; } frt = rt; rt = rt->mf6c_next; - free(frt, M_MRTABLE); + free(frt, M_MRTABLE, 0); } } @@ -793,7 +793,7 @@ add_m6fc(struct mf6cctl *mfccp) ip6_mdq(rte->m, rte->ifp, rt); } m_freem(rte->m); - free(rte, M_MRTABLE); + free(rte, M_MRTABLE, 0); rte = n; } rt->mf6c_stall = NULL; @@ -915,7 +915,7 @@ del_m6fc(struct mf6cctl *mfccp) } *nptr = rt->mf6c_next; - free(rt, M_MRTABLE); + free(rt, M_MRTABLE, 0); splx(s); @@ -1042,7 +1042,7 @@ ip6_mforward(struct ip6_hdr *ip6, struct ifnet *ifp, struct mbuf *m) (M_READONLY(mb0) || mb0->m_len < sizeof(struct ip6_hdr))) mb0 = m_pullup(mb0, sizeof(struct ip6_hdr)); if (mb0 == NULL) { - free(rte, M_MRTABLE); + free(rte, M_MRTABLE, 0); splx(s); return ENOBUFS; } @@ -1065,7 +1065,7 @@ ip6_mforward(struct ip6_hdr *ip6, struct ifnet *ifp, struct mbuf *m) rt = (struct mf6c *)malloc(sizeof(*rt), M_MRTABLE, M_NOWAIT); if (rt == NULL) { - free(rte, M_MRTABLE); + free(rte, M_MRTABLE, 0); m_freem(mb0); splx(s); return ENOBUFS; @@ -1077,9 +1077,9 @@ ip6_mforward(struct ip6_hdr *ip6, struct ifnet *ifp, struct mbuf *m) mm = m_copy(mb0, 0, sizeof(struct ip6_hdr)); if (mm == NULL) { - free(rte, M_MRTABLE); + free(rte, M_MRTABLE, 0); m_freem(mb0); - free(rt, M_MRTABLE); + free(rt, M_MRTABLE, 0); splx(s); return ENOBUFS; } @@ -1100,9 +1100,9 @@ ip6_mforward(struct ip6_hdr *ip6, struct ifnet *ifp, struct mbuf *m) im->im6_mbz = 0; break; default: - free(rte, M_MRTABLE); + free(rte, M_MRTABLE, 0); m_freem(mb0); - free(rt, M_MRTABLE); + free(rt, M_MRTABLE, 0); splx(s); return EINVAL; } @@ -1128,9 +1128,9 @@ ip6_mforward(struct ip6_hdr *ip6, struct ifnet *ifp, struct mbuf *m) log(LOG_WARNING, "ip6_mforward: ip6_mrouter " "socket queue full\n"); mrt6stat.mrt6s_upq_sockfull++; - free(rte, M_MRTABLE); + free(rte, M_MRTABLE, 0); m_freem(mb0); - free(rt, M_MRTABLE); + free(rt, M_MRTABLE, 0); splx(s); return ENOBUFS; } @@ -1162,7 +1162,7 @@ ip6_mforward(struct ip6_hdr *ip6, struct ifnet *ifp, struct mbuf *m) for (p = &rt->mf6c_stall; *p != NULL; p = &(*p)->next) if (++npkts > MAX_UPQ6) { mrt6stat.mrt6s_upq_ovflw++; - free(rte, M_MRTABLE); + free(rte, M_MRTABLE, 0); m_freem(mb0); splx(s); return 0; @@ -1229,14 +1229,14 @@ expire_upcalls(void *unused) do { struct rtdetq *n = rte->next; m_freem(rte->m); - free(rte, M_MRTABLE); + free(rte, M_MRTABLE, 0); rte = n; } while (rte != NULL); mrt6stat.mrt6s_cache_cleanups++; n6expire[i]--; *nptr = mfc->mf6c_next; - free(mfc, M_MRTABLE); + free(mfc, M_MRTABLE, 0); } else { nptr = &mfc->mf6c_next; } diff --git a/sys/netinet6/ip6_output.c b/sys/netinet6/ip6_output.c index d9355271a7b..70d28f0883a 100644 --- a/sys/netinet6/ip6_output.c +++ b/sys/netinet6/ip6_output.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ip6_output.c,v 1.156 2014/04/21 11:10:54 henning Exp $ */ +/* $OpenBSD: ip6_output.c,v 1.157 2014/07/12 18:44:23 tedu Exp $ */ /* $KAME: ip6_output.c,v 1.172 2001/03/25 09:55:56 itojun Exp $ */ /* @@ -2097,7 +2097,7 @@ ip6_pcbopts(struct ip6_pktopts **pktopt, struct mbuf *m, struct socket *so) * Only turning off any previous options, regardless of * whether the opt is just created or given. */ - free(opt, M_IP6OPT); + free(opt, M_IP6OPT, 0); return (0); } @@ -2107,7 +2107,7 @@ ip6_pcbopts(struct ip6_pktopts **pktopt, struct mbuf *m, struct socket *so) if ((error = ip6_setpktopts(m, opt, NULL, priv, so->so_proto->pr_protocol)) != 0) { ip6_clearpktopts(opt, -1); /* XXX discard all options */ - free(opt, M_IP6OPT); + free(opt, M_IP6OPT, 0); return (error); } *pktopt = opt; @@ -2247,7 +2247,7 @@ ip6_clearpktopts(struct ip6_pktopts *pktopt, int optname) { if (optname == -1 || optname == IPV6_PKTINFO) { if (pktopt->ip6po_pktinfo) - free(pktopt->ip6po_pktinfo, M_IP6OPT); + free(pktopt->ip6po_pktinfo, M_IP6OPT, 0); pktopt->ip6po_pktinfo = NULL; } if (optname == -1 || optname == IPV6_HOPLIMIT) @@ -2260,22 +2260,22 @@ ip6_clearpktopts(struct ip6_pktopts *pktopt, int optname) pktopt->ip6po_nextroute.ro_rt = NULL; } if (pktopt->ip6po_nexthop) - free(pktopt->ip6po_nexthop, M_IP6OPT); + free(pktopt->ip6po_nexthop, M_IP6OPT, 0); pktopt->ip6po_nexthop = NULL; } if (optname == -1 || optname == IPV6_HOPOPTS) { if (pktopt->ip6po_hbh) - free(pktopt->ip6po_hbh, M_IP6OPT); + free(pktopt->ip6po_hbh, M_IP6OPT, 0); pktopt->ip6po_hbh = NULL; } if (optname == -1 || optname == IPV6_RTHDRDSTOPTS) { if (pktopt->ip6po_dest1) - free(pktopt->ip6po_dest1, M_IP6OPT); + free(pktopt->ip6po_dest1, M_IP6OPT, 0); pktopt->ip6po_dest1 = NULL; } if (optname == -1 || optname == IPV6_RTHDR) { if (pktopt->ip6po_rhinfo.ip6po_rhi_rthdr) - free(pktopt->ip6po_rhinfo.ip6po_rhi_rthdr, M_IP6OPT); + free(pktopt->ip6po_rhinfo.ip6po_rhi_rthdr, M_IP6OPT, 0); pktopt->ip6po_rhinfo.ip6po_rhi_rthdr = NULL; if (pktopt->ip6po_route.ro_rt) { RTFREE(pktopt->ip6po_route.ro_rt); @@ -2284,7 +2284,7 @@ ip6_clearpktopts(struct ip6_pktopts *pktopt, int optname) } if (optname == -1 || optname == IPV6_DSTOPTS) { if (pktopt->ip6po_dest2) - free(pktopt->ip6po_dest2, M_IP6OPT); + free(pktopt->ip6po_dest2, M_IP6OPT, 0); pktopt->ip6po_dest2 = NULL; } } @@ -2341,7 +2341,7 @@ ip6_freepcbopts(struct ip6_pktopts *pktopt) ip6_clearpktopts(pktopt, -1); - free(pktopt, M_IP6OPT); + free(pktopt, M_IP6OPT, 0); } /* @@ -2617,7 +2617,7 @@ ip6_setmoptions(int optname, struct ip6_moptions **im6op, struct mbuf *m) im6o->im6o_multicast_hlim == ip6_defmcasthlim && im6o->im6o_multicast_loop == IPV6_DEFAULT_MULTICAST_LOOP && LIST_EMPTY(&im6o->im6o_memberships)) { - free(*im6op, M_IPMOPTS); + free(*im6op, M_IPMOPTS, 0); *im6op = NULL; } @@ -2684,7 +2684,7 @@ ip6_freemoptions(struct ip6_moptions *im6o) LIST_REMOVE(imm, i6mm_chain); in6_leavegroup(imm); } - free(im6o, M_IPMOPTS); + free(im6o, M_IPMOPTS, 0); } /* diff --git a/sys/netinet6/nd6.c b/sys/netinet6/nd6.c index 596f52db93e..044a6ea123d 100644 --- a/sys/netinet6/nd6.c +++ b/sys/netinet6/nd6.c @@ -1,4 +1,4 @@ -/* $OpenBSD: nd6.c,v 1.119 2014/07/11 16:39:06 henning Exp $ */ +/* $OpenBSD: nd6.c,v 1.120 2014/07/12 18:44:23 tedu Exp $ */ /* $KAME: nd6.c,v 1.280 2002/06/08 19:52:07 itojun Exp $ */ /* @@ -165,7 +165,7 @@ void nd6_ifdetach(struct nd_ifinfo *nd) { - free(nd, M_IP6NDP); + free(nd, M_IP6NDP, 0); } void @@ -1226,7 +1226,7 @@ nd6_rtrequest(int req, struct rtentry *rt) rt->rt_flags &= ~RTF_LLINFO; if (ln->ln_hold) m_freem(ln->ln_hold); - free(ln, M_RTABLE); + free(ln, M_RTABLE, 0); } } @@ -1920,7 +1920,7 @@ nd6_sysctl(int name, void *oldp, size_t *oldlenp, void *newp, size_t newlen) break; } if (p) - free(p, M_TEMP); + free(p, M_TEMP, 0); return (error); } diff --git a/sys/netinet6/nd6_nbr.c b/sys/netinet6/nd6_nbr.c index 04981ba73f1..c8a3e543c2f 100644 --- a/sys/netinet6/nd6_nbr.c +++ b/sys/netinet6/nd6_nbr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: nd6_nbr.c,v 1.79 2014/06/07 11:04:14 henning Exp $ */ +/* $OpenBSD: nd6_nbr.c,v 1.80 2014/07/12 18:44:23 tedu Exp $ */ /* $KAME: nd6_nbr.c,v 1.61 2001/02/10 16:06:14 jinmei Exp $ */ /* @@ -1226,7 +1226,7 @@ nd6_dad_stop(struct ifaddr *ifa) nd6_dad_stoptimer(dp); TAILQ_REMOVE(&dadq, (struct dadq *)dp, dad_list); - free(dp, M_IP6NDP); + free(dp, M_IP6NDP, 0); dp = NULL; ifafree(ifa); ip6_dad_pending--; @@ -1275,7 +1275,7 @@ nd6_dad_timer(struct ifaddr *ifa) ifa->ifa_ifp->if_xname)); TAILQ_REMOVE(&dadq, (struct dadq *)dp, dad_list); - free(dp, M_IP6NDP); + free(dp, M_IP6NDP, 0); dp = NULL; ifafree(ifa); ip6_dad_pending--; @@ -1330,7 +1330,7 @@ nd6_dad_timer(struct ifaddr *ifa) addr, sizeof(addr)))); TAILQ_REMOVE(&dadq, (struct dadq *)dp, dad_list); - free(dp, M_IP6NDP); + free(dp, M_IP6NDP, 0); dp = NULL; ifafree(ifa); ip6_dad_pending--; @@ -1373,7 +1373,7 @@ nd6_dad_duplicated(struct ifaddr *ifa) ifa->ifa_ifp->if_xname); TAILQ_REMOVE(&dadq, (struct dadq *)dp, dad_list); - free(dp, M_IP6NDP); + free(dp, M_IP6NDP, 0); dp = NULL; ifafree(ifa); ip6_dad_pending--; diff --git a/sys/netinet6/nd6_rtr.c b/sys/netinet6/nd6_rtr.c index c277734167c..e8a7b10d487 100644 --- a/sys/netinet6/nd6_rtr.c +++ b/sys/netinet6/nd6_rtr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: nd6_rtr.c,v 1.82 2014/07/11 16:39:06 henning Exp $ */ +/* $OpenBSD: nd6_rtr.c,v 1.83 2014/07/12 18:44:23 tedu Exp $ */ /* $KAME: nd6_rtr.c,v 1.97 2001/02/07 11:09:13 itojun Exp $ */ /* @@ -515,7 +515,7 @@ defrtrlist_del(struct nd_defrouter *dr) dr->ifp->if_xname); } - free(dr, M_IP6NDP); + free(dr, M_IP6NDP, 0); } /* @@ -859,7 +859,7 @@ void pfxrtr_del(struct nd_pfxrouter *pfr) { LIST_REMOVE(pfr, pfr_entry); - free(pfr, M_IP6NDP); + free(pfr, M_IP6NDP, 0); } struct nd_prefix * @@ -1011,7 +1011,7 @@ prelist_remove(struct nd_prefix *pr) /* free list of routers that adversed the prefix */ LIST_FOREACH_SAFE(pfr, &pr->ndpr_advrtrs, pfr_entry, next) - free(pfr, M_IP6NDP); + free(pfr, M_IP6NDP, 0); ext->nprefixes--; if (ext->nprefixes < 0) { @@ -1020,7 +1020,7 @@ prelist_remove(struct nd_prefix *pr) } splx(s); - free(pr, M_IP6NDP); + free(pr, M_IP6NDP, 0); pfxlist_onlink_check(); } diff --git a/sys/netinet6/raw_ip6.c b/sys/netinet6/raw_ip6.c index 281ddc77ba9..a8198f7e451 100644 --- a/sys/netinet6/raw_ip6.c +++ b/sys/netinet6/raw_ip6.c @@ -1,4 +1,4 @@ -/* $OpenBSD: raw_ip6.c,v 1.66 2014/04/18 10:48:30 jca Exp $ */ +/* $OpenBSD: raw_ip6.c,v 1.67 2014/07/12 18:44:23 tedu Exp $ */ /* $KAME: raw_ip6.c,v 1.69 2001/03/04 15:55:44 itojun Exp $ */ /* @@ -651,7 +651,7 @@ rip6_usrreq(struct socket *so, int req, struct mbuf *m, struct mbuf *nam, ip6_mrouter_done(); #endif if (in6p->inp_icmp6filt) { - free(in6p->inp_icmp6filt, M_PCB); + free(in6p->inp_icmp6filt, M_PCB, 0); in6p->inp_icmp6filt = NULL; } in_pcbdetach(in6p); -- 2.20.1