diff options
author | 2014-07-12 18:44:22 +0000 | |
---|---|---|
committer | 2014-07-12 18:44:22 +0000 | |
commit | dd168dc2dbd0498445c205acd3a92d235cbcb6af (patch) | |
tree | 7468232c146a34628a98058ec363c774cbe975e5 /sys/netinet6 | |
parent | add a size argument to free. will be used soon, but for now default to 0. (diff) | |
download | wireguard-openbsd-dd168dc2dbd0498445c205acd3a92d235cbcb6af.tar.xz wireguard-openbsd-dd168dc2dbd0498445c205acd3a92d235cbcb6af.zip |
add a size argument to free. will be used soon, but for now default to 0.
after discussions with beck deraadt kettenis.
Diffstat (limited to 'sys/netinet6')
-rw-r--r-- | sys/netinet6/frag6.c | 28 | ||||
-rw-r--r-- | sys/netinet6/in6.c | 16 | ||||
-rw-r--r-- | sys/netinet6/ip6_mroute.c | 30 | ||||
-rw-r--r-- | sys/netinet6/ip6_output.c | 24 | ||||
-rw-r--r-- | sys/netinet6/nd6.c | 8 | ||||
-rw-r--r-- | sys/netinet6/nd6_nbr.c | 10 | ||||
-rw-r--r-- | sys/netinet6/nd6_rtr.c | 10 | ||||
-rw-r--r-- | sys/netinet6/raw_ip6.c | 4 |
8 files changed, 65 insertions, 65 deletions
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); |