From 6173a47677f678be4fe37eeed425c20bb05070be Mon Sep 17 00:00:00 2001 From: dyoung Date: Sun, 2 Sep 2007 03:12:23 +0000 Subject: [PATCH] m_copy() was deprecated, apparently, long ago. m_copy(...) -> m_copym(..., M_DONTWAIT). --- sys/netinet/ip_mroute.c | 19 ++++++++++--------- sys/netinet/ip_output.c | 8 ++++---- sys/netinet/raw_ip.c | 6 +++--- sys/netinet/tcp_output.c | 6 +++--- sys/netinet/udp_usrreq.c | 12 ++++++------ 5 files changed, 26 insertions(+), 25 deletions(-) diff --git a/sys/netinet/ip_mroute.c b/sys/netinet/ip_mroute.c index 4ccf1c531a14..610e5e71e86f 100644 --- a/sys/netinet/ip_mroute.c +++ b/sys/netinet/ip_mroute.c @@ -1,4 +1,4 @@ -/* $NetBSD: ip_mroute.c,v 1.106 2007/08/31 23:40:08 dyoung Exp $ */ +/* $NetBSD: ip_mroute.c,v 1.107 2007/09/02 03:12:23 dyoung Exp $ */ /* * Copyright (c) 1992, 1993 @@ -93,7 +93,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: ip_mroute.c,v 1.106 2007/08/31 23:40:08 dyoung Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ip_mroute.c,v 1.107 2007/09/02 03:12:23 dyoung Exp $"); #include "opt_inet.h" #include "opt_ipsec.h" @@ -1497,7 +1497,7 @@ ip_mforward(struct mbuf *m, struct ifnet *ifp) splx(s); return (ENOBUFS); } - mb0 = m_copy(m, 0, M_COPYALL); + mb0 = m_copym(m, 0, M_COPYALL, M_DONTWAIT); M_PULLUP(mb0, hlen); if (mb0 == NULL) { free(rte, M_MRTABLE); @@ -1539,7 +1539,7 @@ ip_mforward(struct mbuf *m, struct ifnet *ifp) * Make a copy of the header to send to the user level * process */ - mm = m_copy(m, 0, hlen); + mm = m_copym(m, 0, hlen, M_DONTWAIT); M_PULLUP(mm, hlen); if (mm == NULL) goto fail1; @@ -1776,7 +1776,8 @@ ip_mdq(struct mbuf *m, struct ifnet *ifp, struct mfc *rt) if (delta > ASSERT_MSG_TIME) { struct igmpmsg *im; int hlen = ip->ip_hl << 2; - struct mbuf *mm = m_copy(m, 0, hlen); + struct mbuf *mm = + m_copym(m, 0, hlen, M_DONTWAIT); M_PULLUP(mm, hlen); if (mm == NULL) @@ -1873,7 +1874,7 @@ phyint_send(struct ip *ip, struct vif *vifp, struct mbuf *m) * the IP header is actually copied, not just referenced, * so that ip_output() only scribbles on the copy. */ - mb_copy = m_copy(m, 0, M_COPYALL); + mb_copy = m_copym(m, 0, M_COPYALL, M_DONTWAIT); M_PULLUP(mb_copy, hlen); if (mb_copy == NULL) return; @@ -1910,7 +1911,7 @@ encap_send(struct ip *ip, struct vif *vifp, struct mbuf *m) mb_copy->m_pkthdr.len = len; mb_copy->m_len = sizeof(multicast_encap_iphdr); - if ((mb_copy->m_next = m_copy(m, 0, M_COPYALL)) == NULL) { + if ((mb_copy->m_next = m_copym(m, 0, M_COPYALL, M_DONTWAIT)) == NULL) { m_freem(mb_copy); return; } @@ -3170,7 +3171,7 @@ pim_register_prepare(struct ip *ip, struct mbuf *m) * Copy the old packet & pullup its IP header into the * new mbuf so we can modify it. */ - mb_copy = m_copy(m, 0, M_COPYALL); + mb_copy = m_copym(m, 0, M_COPYALL, M_DONTWAIT); if (mb_copy == NULL) return NULL; mb_copy = m_pullup(mb_copy, ip->ip_hl << 2); @@ -3532,7 +3533,7 @@ pim_input(struct mbuf *m, ...) * actions (e.g., send back PIM_REGISTER_STOP). * XXX: here m->m_data points to the outer IP header. */ - mcp = m_copy(m, 0, iphlen + PIM_REG_MINLEN); + mcp = m_copym(m, 0, iphlen + PIM_REG_MINLEN, M_DONTWAIT); if (mcp == NULL) { log(LOG_ERR, "pim_input: pim register: could not copy register head\n"); diff --git a/sys/netinet/ip_output.c b/sys/netinet/ip_output.c index 7814f021c833..6be37354d24c 100644 --- a/sys/netinet/ip_output.c +++ b/sys/netinet/ip_output.c @@ -1,4 +1,4 @@ -/* $NetBSD: ip_output.c,v 1.181 2007/08/28 23:45:39 cube Exp $ */ +/* $NetBSD: ip_output.c,v 1.182 2007/09/02 03:12:23 dyoung Exp $ */ /* * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. @@ -98,7 +98,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: ip_output.c,v 1.181 2007/08/28 23:45:39 cube Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ip_output.c,v 1.182 2007/09/02 03:12:23 dyoung Exp $"); #include "opt_pfil_hooks.h" #include "opt_inet.h" @@ -1057,7 +1057,7 @@ ip_fragment(struct mbuf *m, struct ifnet *ifp, u_long mtu) mhip->ip_off |= IP_MF; HTONS(mhip->ip_off); mhip->ip_len = htons((u_int16_t)(len + mhlen)); - m->m_next = m_copy(m0, off, len); + m->m_next = m_copym(m0, off, len, M_DONTWAIT); if (m->m_next == 0) { error = ENOBUFS; /* ??? */ ipstat.ips_odropped++; @@ -1969,7 +1969,7 @@ ip_mloopback(struct ifnet *ifp, struct mbuf *m, const struct sockaddr_in *dst) struct ip *ip; struct mbuf *copym; - copym = m_copy(m, 0, M_COPYALL); + copym = m_copym(m, 0, M_COPYALL, M_DONTWAIT); if (copym != NULL && (copym->m_flags & M_EXT || copym->m_len < sizeof(struct ip))) copym = m_pullup(copym, sizeof(struct ip)); diff --git a/sys/netinet/raw_ip.c b/sys/netinet/raw_ip.c index 82919143daa8..43318b41dac4 100644 --- a/sys/netinet/raw_ip.c +++ b/sys/netinet/raw_ip.c @@ -1,4 +1,4 @@ -/* $NetBSD: raw_ip.c,v 1.97 2007/05/12 02:10:25 dyoung Exp $ */ +/* $NetBSD: raw_ip.c,v 1.98 2007/09/02 03:12:23 dyoung Exp $ */ /* * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. @@ -61,7 +61,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: raw_ip.c,v 1.97 2007/05/12 02:10:25 dyoung Exp $"); +__KERNEL_RCSID(0, "$NetBSD: raw_ip.c,v 1.98 2007/09/02 03:12:23 dyoung Exp $"); #include "opt_inet.h" #include "opt_ipsec.h" @@ -184,7 +184,7 @@ rip_input(struct mbuf *m, ...) /* do not inject data to pcb */ } #endif /*IPSEC*/ - else if ((n = m_copy(m, 0, M_COPYALL)) != NULL) { + else if ((n = m_copym(m, 0, M_COPYALL, M_DONTWAIT)) != NULL) { if (last->inp_flags & INP_CONTROLOPTS || last->inp_socket->so_options & SO_TIMESTAMP) ip_savecontrol(last, &opts, ip, n); diff --git a/sys/netinet/tcp_output.c b/sys/netinet/tcp_output.c index 31e3545d302e..a9fa424124c1 100644 --- a/sys/netinet/tcp_output.c +++ b/sys/netinet/tcp_output.c @@ -1,4 +1,4 @@ -/* $NetBSD: tcp_output.c,v 1.161 2007/08/02 13:12:35 yamt Exp $ */ +/* $NetBSD: tcp_output.c,v 1.162 2007/09/02 03:12:23 dyoung Exp $ */ /* * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. @@ -142,7 +142,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: tcp_output.c,v 1.161 2007/08/02 13:12:35 yamt Exp $"); +__KERNEL_RCSID(0, "$NetBSD: tcp_output.c,v 1.162 2007/09/02 03:12:23 dyoung Exp $"); #include "opt_inet.h" #include "opt_ipsec.h" @@ -528,7 +528,7 @@ tcp_build_datapkt(struct tcpcb *tp, struct socket *so, int off, m->m_len += len; TCP_OUTPUT_COUNTER_INCR(&tcp_output_copysmall); } else { - m->m_next = m_copy(m0, off, (int) len); + m->m_next = m_copym(m0, off, (int) len, M_DONTWAIT); if (m->m_next == NULL) { m_freem(m); return (ENOBUFS); diff --git a/sys/netinet/udp_usrreq.c b/sys/netinet/udp_usrreq.c index 6e365e0279cb..f969d1971e78 100644 --- a/sys/netinet/udp_usrreq.c +++ b/sys/netinet/udp_usrreq.c @@ -1,4 +1,4 @@ -/* $NetBSD: udp_usrreq.c,v 1.160 2007/06/27 20:38:32 degroote Exp $ */ +/* $NetBSD: udp_usrreq.c,v 1.161 2007/09/02 03:12:23 dyoung Exp $ */ /* * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. @@ -61,7 +61,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: udp_usrreq.c,v 1.160 2007/06/27 20:38:32 degroote Exp $"); +__KERNEL_RCSID(0, "$NetBSD: udp_usrreq.c,v 1.161 2007/09/02 03:12:23 dyoung Exp $"); #include "opt_inet.h" #include "opt_ipsec.h" @@ -617,14 +617,14 @@ udp4_sendup(struct mbuf *m, int off /* offset of data portion */, /* check AH/ESP integrity. */ if (so != NULL && ipsec4_in_reject_so(m, so)) { ipsecstat.in_polvio++; - if ((n = m_copy(m, 0, M_COPYALL)) != NULL) + if ((n = m_copym(m, 0, M_COPYALL, M_DONTWAIT)) != NULL) icmp_error(n, ICMP_UNREACH, ICMP_UNREACH_ADMIN_PROHIBIT, 0, 0); return; } #endif /*IPSEC*/ - if ((n = m_copy(m, 0, M_COPYALL)) != NULL) { + if ((n = m_copym(m, 0, M_COPYALL, M_DONTWAIT)) != NULL) { if (inp && (inp->inp_flags & INP_CONTROLOPTS || so->so_options & SO_TIMESTAMP)) { struct ip *ip = mtod(n, struct ip *); @@ -664,14 +664,14 @@ udp6_sendup(struct mbuf *m, int off /* offset of data portion */, /* check AH/ESP integrity. */ if (so != NULL && ipsec6_in_reject_so(m, so)) { ipsec6stat.in_polvio++; - if ((n = m_copy(m, 0, M_COPYALL)) != NULL) + if ((n = m_copym(m, 0, M_COPYALL, M_DONTWAIT)) != NULL) icmp6_error(n, ICMP6_DST_UNREACH, ICMP6_DST_UNREACH_ADMIN, 0); return; } #endif /*IPSEC*/ - if ((n = m_copy(m, 0, M_COPYALL)) != NULL) { + if ((n = m_copym(m, 0, M_COPYALL, M_DONTWAIT)) != NULL) { if (in6p && (in6p->in6p_flags & IN6P_CONTROLOPTS || in6p->in6p_socket->so_options & SO_TIMESTAMP)) { struct ip6_hdr *ip6 = mtod(n, struct ip6_hdr *);