diff options
author | Charles Longeau <chl@cvs.openbsd.org> | 2007-10-29 16:19:25 +0000 |
---|---|---|
committer | Charles Longeau <chl@cvs.openbsd.org> | 2007-10-29 16:19:25 +0000 |
commit | f2d4d50433f1f93a99e18ff5273855ba5561c778 (patch) | |
tree | 7f4f3fad78d457bfe04ce8a19d19417cadf63cdd /sys/netinet | |
parent | 27d9171c0aadbac51ead3eedd49831f81d9f5536 (diff) |
MALLOC/FREE -> malloc/free
ok krw@
Diffstat (limited to 'sys/netinet')
-rw-r--r-- | sys/netinet/ip_carp.c | 22 | ||||
-rw-r--r-- | sys/netinet/ip_input.c | 9 | ||||
-rw-r--r-- | sys/netinet/ip_ipsp.c | 4 | ||||
-rw-r--r-- | sys/netinet/ip_output.c | 13 |
4 files changed, 22 insertions, 26 deletions
diff --git a/sys/netinet/ip_carp.c b/sys/netinet/ip_carp.c index fd5bf8c4af1..ddb0d21323c 100644 --- a/sys/netinet/ip_carp.c +++ b/sys/netinet/ip_carp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ip_carp.c,v 1.152 2007/10/27 23:08:35 mpf Exp $ */ +/* $OpenBSD: ip_carp.c,v 1.153 2007/10/29 16:19:23 chl Exp $ */ /* * Copyright (c) 2002 Michael Shalayeff. All rights reserved. @@ -884,7 +884,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); } } sc->sc_carpdev = NULL; @@ -1680,12 +1680,11 @@ carp_set_ifp(struct carp_softc *sc, struct ifnet *ifp) return (EINVAL); if (ifp->if_carp == NULL) { - MALLOC(ncif, struct carp_if *, sizeof(*cif), - M_IFADDR, M_NOWAIT); + ncif = malloc(sizeof(*cif), M_IFADDR, M_NOWAIT); if (ncif == NULL) return (ENOBUFS); if ((error = ifpromisc(ifp, 1))) { - FREE(ncif, M_IFADDR); + free(ncif, M_IFADDR); return (error); } @@ -1706,7 +1705,7 @@ carp_set_ifp(struct carp_softc *sc, struct ifnet *ifp) if (sc->sc_naddrs < 0 && (error = carp_join_multicast(sc)) != 0) { if (ncif != NULL) - FREE(ncif, M_IFADDR); + free(ncif, M_IFADDR); return (error); } @@ -1714,7 +1713,7 @@ carp_set_ifp(struct carp_softc *sc, struct ifnet *ifp) if (sc->sc_naddrs6 < 0 && (error = carp_join_multicast6(sc)) != 0) { if (ncif != NULL) - FREE(ncif, M_IFADDR); + free(ncif, M_IFADDR); carp_multicast_cleanup(sc); return (error); } @@ -2389,8 +2388,7 @@ carp_ether_addmulti(struct carp_softc *sc, struct ifreq *ifr) * about it. Also, remember this multicast address so that * we can delete them on unconfigure. */ - MALLOC(mc, struct carp_mc_entry *, sizeof(struct carp_mc_entry), - M_DEVBUF, M_NOWAIT); + mc = malloc(sizeof(struct carp_mc_entry), M_DEVBUF, M_NOWAIT); if (mc == NULL) { error = ENOMEM; goto alloc_failed; @@ -2413,7 +2411,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); alloc_failed: (void)ether_delmulti(ifr, (struct arpcom *)&sc->sc_ac); @@ -2460,7 +2458,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); } else (void)ether_addmulti(ifr, (struct arpcom *)&sc->sc_ac); return (error); @@ -2492,6 +2490,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); } } diff --git a/sys/netinet/ip_input.c b/sys/netinet/ip_input.c index 22cc242fa8c..c36cd44fe0e 100644 --- a/sys/netinet/ip_input.c +++ b/sys/netinet/ip_input.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ip_input.c,v 1.153 2007/09/10 23:05:39 thib Exp $ */ +/* $OpenBSD: ip_input.c,v 1.154 2007/10/29 16:19:23 chl Exp $ */ /* $NetBSD: ip_input.c,v 1.30 1996/03/16 23:53:58 christos Exp $ */ /* @@ -724,8 +724,7 @@ ip_reass(ipqe, fp) * If first fragment to arrive, create a reassembly queue. */ if (fp == 0) { - MALLOC(fp, struct ipq *, sizeof (struct ipq), - M_FTABLE, M_NOWAIT); + fp = malloc(sizeof (struct ipq), M_FTABLE, M_NOWAIT); if (fp == NULL) goto dropfrag; LIST_INSERT_HEAD(&ipq, fp, ipq_q); @@ -862,7 +861,7 @@ insert: ip->ip_src = fp->ipq_src; ip->ip_dst = fp->ipq_dst; LIST_REMOVE(fp, ipq_q); - FREE(fp, M_FTABLE); + free(fp, M_FTABLE); m->m_len += (ip->ip_hl << 2); m->m_data -= (ip->ip_hl << 2); /* some debugging cruft by sklower, below, will go away soon */ @@ -901,7 +900,7 @@ ip_freef(fp) ip_frags--; } LIST_REMOVE(fp, ipq_q); - FREE(fp, M_FTABLE); + free(fp, M_FTABLE); } /* diff --git a/sys/netinet/ip_ipsp.c b/sys/netinet/ip_ipsp.c index 8f9b274dbca..993fc376bf1 100644 --- a/sys/netinet/ip_ipsp.c +++ b/sys/netinet/ip_ipsp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ip_ipsp.c,v 1.169 2007/10/09 01:49:30 krw Exp $ */ +/* $OpenBSD: ip_ipsp.c,v 1.170 2007/10/29 16:19:23 chl Exp $ */ /* * The authors of this code are John Ioannidis (ji@tla.org), * Angelos D. Keromytis (kermit@csd.uch.gr), @@ -1024,7 +1024,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); } /* Mark a TDB as TDBF_SKIPCRYPTO. */ diff --git a/sys/netinet/ip_output.c b/sys/netinet/ip_output.c index 73490dcc154..0490f62a3cd 100644 --- a/sys/netinet/ip_output.c +++ b/sys/netinet/ip_output.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ip_output.c,v 1.189 2007/09/18 18:56:02 markus Exp $ */ +/* $OpenBSD: ip_output.c,v 1.190 2007/10/29 16:19:23 chl Exp $ */ /* $NetBSD: ip_output.c,v 1.28 1996/02/13 23:43:07 christos Exp $ */ /* @@ -1303,8 +1303,7 @@ ip_ctloutput(op, so, level, optname, mp) } } - MALLOC(ipr, struct ipsec_ref *, - sizeof(struct ipsec_ref) + m->m_len - 2, + ipr = malloc(sizeof(struct ipsec_ref) + m->m_len - 2, M_CREDENTIALS, M_NOWAIT); if (ipr == NULL) { error = ENOBUFS; @@ -1323,7 +1322,7 @@ ip_ctloutput(op, so, level, optname, mp) 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); error = EINVAL; } else { if (inp->inp_ipo->ipo_srcid != NULL) @@ -1336,7 +1335,7 @@ ip_ctloutput(op, so, level, optname, mp) 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); error = EINVAL; } else { if (inp->inp_ipo->ipo_dstid != NULL) @@ -1347,7 +1346,7 @@ ip_ctloutput(op, so, level, optname, mp) 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); error = EINVAL; } else { if (inp->inp_ipo->ipo_local_cred != NULL) @@ -1358,7 +1357,7 @@ ip_ctloutput(op, so, level, optname, mp) 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); error = EINVAL; } else { if (inp->inp_ipo->ipo_local_auth != NULL) |