Module Name:    src
Committed By:   maxv
Date:           Thu May  3 07:01:08 UTC 2018

Modified Files:
        src/sys/dist/pf/net: pf.c
        src/sys/external/bsd/ipf/netinet: ip_compat.h ip_fil_netbsd.c
        src/sys/netinet: dccp_usrreq.c sctp_output.c
        src/sys/sys: mbuf.h

Log Message:
Remove m_copy completely.


To generate a diff of this commit:
cvs rdiff -u -r1.80 -r1.81 src/sys/dist/pf/net/pf.c
cvs rdiff -u -r1.12 -r1.13 src/sys/external/bsd/ipf/netinet/ip_compat.h
cvs rdiff -u -r1.26 -r1.27 src/sys/external/bsd/ipf/netinet/ip_fil_netbsd.c
cvs rdiff -u -r1.17 -r1.18 src/sys/netinet/dccp_usrreq.c
cvs rdiff -u -r1.14 -r1.15 src/sys/netinet/sctp_output.c
cvs rdiff -u -r1.200 -r1.201 src/sys/sys/mbuf.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dist/pf/net/pf.c
diff -u src/sys/dist/pf/net/pf.c:1.80 src/sys/dist/pf/net/pf.c:1.81
--- src/sys/dist/pf/net/pf.c:1.80	Mon Feb 19 23:03:00 2018
+++ src/sys/dist/pf/net/pf.c	Thu May  3 07:01:08 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: pf.c,v 1.80 2018/02/19 23:03:00 christos Exp $	*/
+/*	$NetBSD: pf.c,v 1.81 2018/05/03 07:01:08 maxv Exp $	*/
 /*	$OpenBSD: pf.c,v 1.552.2.1 2007/11/27 16:37:57 henning Exp $ */
 
 /*
@@ -37,7 +37,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: pf.c,v 1.80 2018/02/19 23:03:00 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pf.c,v 1.81 2018/05/03 07:01:08 maxv Exp $");
 
 #include "pflog.h"
 
@@ -1856,7 +1856,11 @@ pf_send_icmp(struct mbuf *m, u_int8_t ty
 	struct pf_mtag	*pf_mtag;
 #endif /* __NetBSD__ */
 
+#ifdef __NetBSD__
+	m0 = m_copym(m, 0, M_COPYALL, M_DONTWAIT);
+#else
 	m0 = m_copy(m, 0, M_COPYALL);
+#endif
 
 #ifdef __NetBSD__
 	if ((pf_mtag = pf_get_mtag(m0)) == NULL)

Index: src/sys/external/bsd/ipf/netinet/ip_compat.h
diff -u src/sys/external/bsd/ipf/netinet/ip_compat.h:1.12 src/sys/external/bsd/ipf/netinet/ip_compat.h:1.13
--- src/sys/external/bsd/ipf/netinet/ip_compat.h:1.12	Tue May  1 07:07:00 2018
+++ src/sys/external/bsd/ipf/netinet/ip_compat.h	Thu May  3 07:01:08 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: ip_compat.h,v 1.12 2018/05/01 07:07:00 maxv Exp $	*/
+/*	$NetBSD: ip_compat.h,v 1.13 2018/05/03 07:01:08 maxv Exp $	*/
 
 /*
  * Copyright (C) 2012 by Darren Reed.
@@ -251,7 +251,7 @@ struct file;
 #  define	MSGDSIZE(m)	mbufchainlen(m)
 #  define	M_LEN(m)	(m)->m_len
 #  define	M_ADJ(m,x)	m_adj(m, x)
-#  define	M_COPY(x)	m_copy((x), 0, M_COPYALL)
+#  define	M_COPY(x)	m_copym((x), 0, M_COPYALL, M_DONTWAIT)
 #  define	GETKTIME(x)	microtime((struct timeval *)x)
 #  define	IPF_PANIC(x,y)	if (x) { printf y; panic("ipf_panic"); }
 #  define	COPYIN(a,b,c)	copyin((void *)(a), (void *)(b), (c))

Index: src/sys/external/bsd/ipf/netinet/ip_fil_netbsd.c
diff -u src/sys/external/bsd/ipf/netinet/ip_fil_netbsd.c:1.26 src/sys/external/bsd/ipf/netinet/ip_fil_netbsd.c:1.27
--- src/sys/external/bsd/ipf/netinet/ip_fil_netbsd.c:1.26	Sun Jul 23 06:19:00 2017
+++ src/sys/external/bsd/ipf/netinet/ip_fil_netbsd.c	Thu May  3 07:01:08 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: ip_fil_netbsd.c,v 1.26 2017/07/23 06:19:00 christos Exp $	*/
+/*	$NetBSD: ip_fil_netbsd.c,v 1.27 2018/05/03 07:01:08 maxv Exp $	*/
 
 /*
  * Copyright (C) 2012 by Darren Reed.
@@ -8,7 +8,7 @@
 #if !defined(lint)
 #if defined(__NetBSD__)
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ip_fil_netbsd.c,v 1.26 2017/07/23 06:19:00 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ip_fil_netbsd.c,v 1.27 2018/05/03 07:01:08 maxv Exp $");
 #else
 static const char sccsid[] = "@(#)ip_fil.c	2.41 6/5/96 (C) 1993-2000 Darren Reed";
 static const char rcsid[] = "@(#)Id: ip_fil_netbsd.c,v 1.1.1.2 2012/07/22 13:45:17 darrenr Exp";
@@ -1312,7 +1312,7 @@ ipf_fastroute(mb_t *m0, mb_t **mpp, fr_i
 		else
 			mhip->ip_off |= IP_MF;
 		mhip->ip_len = htons((u_short)(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;	/* ??? */
 			goto sendorfree;

Index: src/sys/netinet/dccp_usrreq.c
diff -u src/sys/netinet/dccp_usrreq.c:1.17 src/sys/netinet/dccp_usrreq.c:1.18
--- src/sys/netinet/dccp_usrreq.c:1.17	Thu Feb  8 09:05:20 2018
+++ src/sys/netinet/dccp_usrreq.c	Thu May  3 07:01:08 2018
@@ -1,5 +1,5 @@
 /*	$KAME: dccp_usrreq.c,v 1.67 2005/11/03 16:05:04 nishida Exp $	*/
-/*	$NetBSD: dccp_usrreq.c,v 1.17 2018/02/08 09:05:20 dholland Exp $ */
+/*	$NetBSD: dccp_usrreq.c,v 1.18 2018/05/03 07:01:08 maxv Exp $ */
 
 /*
  * Copyright (c) 2003 Joacim H�ggmark, Magnus Erixzon, Nils-Erik Mattsson 
@@ -67,7 +67,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: dccp_usrreq.c,v 1.17 2018/02/08 09:05:20 dholland Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dccp_usrreq.c,v 1.18 2018/05/03 07:01:08 maxv Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -1413,7 +1413,8 @@ again:
 			mtod(m, char *) + hdrlen);
 			m->m_len += len;
 		} else {
-			m->m_next = m_copy(so->so_snd.sb_mb, off, (int) len);
+			m->m_next = m_copym(so->so_snd.sb_mb, off,
+			    (int)len, M_DONTWAIT);
 			if (m->m_next == 0) {
 				error = ENOBUFS;
 				goto release;

Index: src/sys/netinet/sctp_output.c
diff -u src/sys/netinet/sctp_output.c:1.14 src/sys/netinet/sctp_output.c:1.15
--- src/sys/netinet/sctp_output.c:1.14	Tue May  1 07:21:39 2018
+++ src/sys/netinet/sctp_output.c	Thu May  3 07:01:08 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: sctp_output.c,v 1.14 2018/05/01 07:21:39 maxv Exp $ */
+/*	$NetBSD: sctp_output.c,v 1.15 2018/05/03 07:01:08 maxv Exp $ */
 /*	$KAME: sctp_output.c,v 1.48 2005/06/16 18:29:24 jinmei Exp $	*/
 
 /*
@@ -30,7 +30,7 @@
  * SUCH DAMAGE.
  */
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: sctp_output.c,v 1.14 2018/05/01 07:21:39 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sctp_output.c,v 1.15 2018/05/03 07:01:08 maxv Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_ipsec.h"
@@ -4611,7 +4611,7 @@ sctp_copy_mbufchain(struct mbuf *clonech
 		appendchain = m_copypacket(clonechain, M_DONTWAIT);
 		sctp_pegs[SCTP_CACHED_SRC]++;
 	} else
-		appendchain = m_copy(clonechain, 0, M_COPYALL);
+		appendchain = m_copym(clonechain, 0, M_COPYALL, M_DONTWAIT);
 #elif defined(__APPLE__)
 	appendchain = sctp_m_copym(clonechain, 0, M_COPYALL, M_DONTWAIT);
 #else
@@ -6400,7 +6400,7 @@ sctp_send_asconf_ack(struct sctp_tcb *st
 		m_ack = m_copypacket(stcb->asoc.last_asconf_ack_sent, M_DONTWAIT);
 		sctp_pegs[SCTP_CACHED_SRC]++;
 	} else
-		m_ack = m_copy(stcb->asoc.last_asconf_ack_sent, 0, M_COPYALL);
+		m_ack = m_copym(stcb->asoc.last_asconf_ack_sent, 0, M_COPYALL, M_DONTWAIT);
 #else
 		m_ack = m_copy(stcb->asoc.last_asconf_ack_sent, 0, M_COPYALL);
 #endif

Index: src/sys/sys/mbuf.h
diff -u src/sys/sys/mbuf.h:1.200 src/sys/sys/mbuf.h:1.201
--- src/sys/sys/mbuf.h:1.200	Sun Apr 29 07:13:10 2018
+++ src/sys/sys/mbuf.h	Thu May  3 07:01:08 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: mbuf.h,v 1.200 2018/04/29 07:13:10 maxv Exp $	*/
+/*	$NetBSD: mbuf.h,v 1.201 2018/05/03 07:01:08 maxv Exp $	*/
 
 /*
  * Copyright (c) 1996, 1997, 1999, 2001, 2007 The NetBSD Foundation, Inc.
@@ -636,9 +636,6 @@ do {									\
 /* The "copy all" special length. */
 #define	M_COPYALL	-1
 
-/* compatibility with 4.3 */
-#define  m_copy(m, o, l)	m_copym((m), (o), (l), M_DONTWAIT)
-
 /*
  * Allow drivers and/or protocols to store private context information.
  */

Reply via email to