diff options
author | Angelos D. Keromytis <angelos@cvs.openbsd.org> | 2001-06-27 03:49:56 +0000 |
---|---|---|
committer | Angelos D. Keromytis <angelos@cvs.openbsd.org> | 2001-06-27 03:49:56 +0000 |
commit | 5a60def576e7a9fc33be3c2ce84e9c5a4ea87acf (patch) | |
tree | eec94d4164616ff7c03e306b4723bda222307b2f /sys | |
parent | cc7d393f894b86439bc3d6e082a11123747a46bd (diff) |
Get rid of M_COPY_* macros; either use M_MOVE_* or M_DUP_*, depending
on how macros should be treated. Code by fgsch@, ok by me and itojun@
Diffstat (limited to 'sys')
-rw-r--r-- | sys/dev/ic/awi.c | 4 | ||||
-rw-r--r-- | sys/kern/uipc_mbuf.c | 8 | ||||
-rw-r--r-- | sys/net/if_gre.c | 4 | ||||
-rw-r--r-- | sys/net/if_ppp.c | 4 | ||||
-rw-r--r-- | sys/net/if_vlan.c | 4 | ||||
-rw-r--r-- | sys/netccitt/if_x25subr.c | 4 | ||||
-rw-r--r-- | sys/netinet/ip_ether.c | 4 | ||||
-rw-r--r-- | sys/netinet/ip_output.c | 4 | ||||
-rw-r--r-- | sys/netinet6/icmp6.c | 4 | ||||
-rw-r--r-- | sys/netinet6/ip6_output.c | 4 | ||||
-rw-r--r-- | sys/netipx/spx_usrreq.c | 4 | ||||
-rw-r--r-- | sys/netiso/if_eon.c | 4 | ||||
-rw-r--r-- | sys/netiso/tp_cons.c | 4 | ||||
-rw-r--r-- | sys/netiso/tp_inet.c | 4 | ||||
-rw-r--r-- | sys/netiso/tuba_subr.c | 4 | ||||
-rw-r--r-- | sys/netns/ns_ip.c | 4 | ||||
-rw-r--r-- | sys/netns/spp_usrreq.c | 4 | ||||
-rw-r--r-- | sys/sys/mbuf.h | 14 |
18 files changed, 43 insertions, 43 deletions
diff --git a/sys/dev/ic/awi.c b/sys/dev/ic/awi.c index 7ba40766759..af0ba52df5d 100644 --- a/sys/dev/ic/awi.c +++ b/sys/dev/ic/awi.c @@ -1,4 +1,4 @@ -/* $OpenBSD: awi.c,v 1.6 2001/06/24 04:31:06 fgsch Exp $ */ +/* $OpenBSD: awi.c,v 1.7 2001/06/27 03:49:52 angelos Exp $ */ /* $NetBSD: awi.c,v 1.26 2000/07/21 04:48:55 onoe Exp $ */ /*- @@ -1176,7 +1176,7 @@ awi_fix_rxhdr(sc, m0) m_freem(m0); return NULL; } - M_COPY_PKTHDR(n, m0); + M_MOVE_PKTHDR(n, m0); n->m_len = MHLEN; } else { MGET(n, M_DONTWAIT, MT_DATA); diff --git a/sys/kern/uipc_mbuf.c b/sys/kern/uipc_mbuf.c index a48b1a4edfa..8cb06fdf542 100644 --- a/sys/kern/uipc_mbuf.c +++ b/sys/kern/uipc_mbuf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uipc_mbuf.c,v 1.37 2001/06/26 06:27:40 aaron Exp $ */ +/* $OpenBSD: uipc_mbuf.c,v 1.38 2001/06/27 03:49:52 angelos Exp $ */ /* $NetBSD: uipc_mbuf.c,v 1.15.4.1 1996/06/13 17:11:44 cgd Exp $ */ /* @@ -290,7 +290,7 @@ m_prepend(m, len, how) return (NULL); } if (m->m_flags & M_PKTHDR) - M_COPY_PKTHDR(mn, m); + M_MOVE_PKTHDR(mn, m); mn->m_next = m; m = mn; if (len < MHLEN) @@ -592,7 +592,7 @@ m_pullup(n, len) goto bad; m->m_len = 0; if (n->m_flags & M_PKTHDR) - M_COPY_PKTHDR(m, n); + M_MOVE_PKTHDR(m, n); } space = &m->m_dat[MLEN] - (m->m_data + m->m_len); do { @@ -661,7 +661,7 @@ m_pullup2(n, len) /* Too many adverse side effects. */ /* M_COPY_PKTHDR(m, n); */ m->m_flags = (n->m_flags & M_COPYFLAGS) | M_EXT; - M_COPY_HDR(m, n); + M_MOVE_HDR(m, n); /* n->m_data is cool. */ } } diff --git a/sys/net/if_gre.c b/sys/net/if_gre.c index 31e6c1be535..27c6f00d41a 100644 --- a/sys/net/if_gre.c +++ b/sys/net/if_gre.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_gre.c,v 1.16 2001/06/25 06:31:44 angelos Exp $ */ +/* $OpenBSD: if_gre.c,v 1.17 2001/06/27 03:49:53 angelos Exp $ */ /* $NetBSD: if_gre.c,v 1.9 1999/10/25 19:18:11 drochner Exp $ */ /* @@ -260,7 +260,7 @@ gre_output(struct ifnet *ifp, struct mbuf *m, struct sockaddr *dst, m_freem(m); return (ENOBUFS); } - M_COPY_HDR(m0, m); + M_MOVE_HDR(m0, m); m0->m_len = msiz + (inp->ip_hl << 2); m0->m_data += max_linkhdr; diff --git a/sys/net/if_ppp.c b/sys/net/if_ppp.c index bd521d27fe8..96fbe46d218 100644 --- a/sys/net/if_ppp.c +++ b/sys/net/if_ppp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_ppp.c,v 1.21 2001/06/25 01:50:17 fgsch Exp $ */ +/* $OpenBSD: if_ppp.c,v 1.22 2001/06/27 03:49:53 angelos Exp $ */ /* $NetBSD: if_ppp.c,v 1.39 1997/05/17 21:11:59 christos Exp $ */ /* @@ -1288,7 +1288,7 @@ ppp_inproc(sc, m) } } if (m->m_flags & M_PKTHDR) - M_COPY_HDR(mp, m); + M_MOVE_HDR(mp, m); cp = mtod(mp, u_char *); cp[0] = adrs; cp[1] = ctrl; diff --git a/sys/net/if_vlan.c b/sys/net/if_vlan.c index 0d75bdce57b..fcb27c76b22 100644 --- a/sys/net/if_vlan.c +++ b/sys/net/if_vlan.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_vlan.c,v 1.22 2001/06/25 02:53:29 angelos Exp $ */ +/* $OpenBSD: if_vlan.c,v 1.23 2001/06/27 03:49:53 angelos Exp $ */ /* * Copyright 1998 Massachusetts Institute of Technology * @@ -248,7 +248,7 @@ vlan_start(struct ifnet *ifp) } if (m0->m_flags & M_PKTHDR) - M_COPY_PKTHDR(m0, m); + M_MOVE_PKTHDR(m0, m); m0->m_flags &= ~M_PROTO1; m0->m_next = m; diff --git a/sys/netccitt/if_x25subr.c b/sys/netccitt/if_x25subr.c index 8e3ea1edaeb..d0f8319eac5 100644 --- a/sys/netccitt/if_x25subr.c +++ b/sys/netccitt/if_x25subr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_x25subr.c,v 1.8 2001/06/25 01:50:17 fgsch Exp $ */ +/* $OpenBSD: if_x25subr.c,v 1.9 2001/06/27 03:49:53 angelos Exp $ */ /* $NetBSD: if_x25subr.c,v 1.13 1996/05/09 22:29:25 scottr Exp $ */ /* @@ -345,7 +345,7 @@ x25_ifoutput(ifp, m0, dst, rt) m = m_gethdr(M_NOWAIT, MT_HEADER); if (m == 0) senderr(ENOBUFS); - M_COPY_HDR(m, m0); + M_MOVE_HDR(m, m0); m->m_pkthdr.len = plen; m->m_next = m0; } diff --git a/sys/netinet/ip_ether.c b/sys/netinet/ip_ether.c index b862d645997..3e60e45206d 100644 --- a/sys/netinet/ip_ether.c +++ b/sys/netinet/ip_ether.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ip_ether.c,v 1.33 2001/06/26 04:29:05 angelos Exp $ */ +/* $OpenBSD: ip_ether.c,v 1.34 2001/06/27 03:49:53 angelos Exp $ */ /* * The author of this code is Angelos D. Keromytis (kermit@adk.gr) * @@ -350,7 +350,7 @@ etherip_output(struct mbuf *m, struct tdb *tdb, struct mbuf **mp, int skip, m_freem(m); return ENOBUFS; } - M_COPY_PKTHDR(m0, m); + M_MOVE_PKTHDR(m0, m); m0->m_next = m; m0->m_len = hlen; m0->m_pkthdr.len += hlen; diff --git a/sys/netinet/ip_output.c b/sys/netinet/ip_output.c index 3ad478bd0e3..f529dba7e3a 100644 --- a/sys/netinet/ip_output.c +++ b/sys/netinet/ip_output.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ip_output.c,v 1.129 2001/06/27 02:52:40 angelos Exp $ */ +/* $OpenBSD: ip_output.c,v 1.130 2001/06/27 03:49:53 angelos Exp $ */ /* $NetBSD: ip_output.c,v 1.28 1996/02/13 23:43:07 christos Exp $ */ /* @@ -848,7 +848,7 @@ ip_insertoptions(m, opt, phlen) MGETHDR(n, M_DONTWAIT, MT_HEADER); if (n == 0) return (m); - M_COPY_HDR(n, m); + M_MOVE_HDR(n, m); n->m_pkthdr.len += optlen; m->m_len -= sizeof(struct ip); m->m_data += sizeof(struct ip); diff --git a/sys/netinet6/icmp6.c b/sys/netinet6/icmp6.c index 32a4078bb2f..4d94d183eaa 100644 --- a/sys/netinet6/icmp6.c +++ b/sys/netinet6/icmp6.c @@ -1,4 +1,4 @@ -/* $OpenBSD: icmp6.c,v 1.46 2001/06/26 19:58:57 itojun Exp $ */ +/* $OpenBSD: icmp6.c,v 1.47 2001/06/27 03:49:54 angelos Exp $ */ /* $KAME: icmp6.c,v 1.217 2001/06/20 15:03:29 jinmei Exp $ */ /* @@ -609,7 +609,7 @@ icmp6_input(mp, offp, proto) m_freem(n0); break; } - M_COPY_PKTHDR(n, n0); + M_MOVE_PKTHDR(n, n0); /* * Copy IPv6 and ICMPv6 only. */ diff --git a/sys/netinet6/ip6_output.c b/sys/netinet6/ip6_output.c index 1ad8295e6aa..a1fc7cf1474 100644 --- a/sys/netinet6/ip6_output.c +++ b/sys/netinet6/ip6_output.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ip6_output.c,v 1.45 2001/06/27 01:36:02 angelos Exp $ */ +/* $OpenBSD: ip6_output.c,v 1.46 2001/06/27 03:49:54 angelos Exp $ */ /* $KAME: ip6_output.c,v 1.172 2001/03/25 09:55:56 itojun Exp $ */ /* @@ -2310,7 +2310,7 @@ ip6_splithdr(m, exthdrs) m_freem(m); return ENOBUFS; } - M_COPY_PKTHDR(mh, m); + M_MOVE_PKTHDR(mh, m); MH_ALIGN(mh, sizeof(*ip6)); m->m_len -= sizeof(*ip6); m->m_data += sizeof(*ip6); diff --git a/sys/netipx/spx_usrreq.c b/sys/netipx/spx_usrreq.c index 3b70328ebde..9225bb3680a 100644 --- a/sys/netipx/spx_usrreq.c +++ b/sys/netipx/spx_usrreq.c @@ -1,4 +1,4 @@ -/* $OpenBSD: spx_usrreq.c,v 1.15 2001/06/25 01:50:17 fgsch Exp $ */ +/* $OpenBSD: spx_usrreq.c,v 1.16 2001/06/27 03:49:54 angelos Exp $ */ /*- * @@ -798,7 +798,7 @@ spx_output(cb, m0) * Fill in mbuf with extended SP header * and addresses and length put into network format. */ - M_COPY_HDR(m, m0); + M_MOVE_HDR(m, m0); MH_ALIGN(m, sizeof(struct spx)); m->m_len = sizeof(struct spx); m->m_next = m0; diff --git a/sys/netiso/if_eon.c b/sys/netiso/if_eon.c index d012293f851..9e22247e001 100644 --- a/sys/netiso/if_eon.c +++ b/sys/netiso/if_eon.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_eon.c,v 1.12 2001/06/25 01:50:17 fgsch Exp $ */ +/* $OpenBSD: if_eon.c,v 1.13 2001/06/27 03:49:54 angelos Exp $ */ /* $NetBSD: if_eon.c,v 1.15 1996/05/09 22:29:37 scottr Exp $ */ /*- @@ -416,7 +416,7 @@ send: MGETHDR(mh, M_DONTWAIT, MT_HEADER); if (mh == (struct mbuf *) 0) goto flush; - M_COPY_HDR(mh, m); + M_MOVE_HDR(mh, m); mh->m_next = m; m = mh; MH_ALIGN(m, sizeof(struct eon_iphdr)); diff --git a/sys/netiso/tp_cons.c b/sys/netiso/tp_cons.c index fdd833f4741..d5cb50ee216 100644 --- a/sys/netiso/tp_cons.c +++ b/sys/netiso/tp_cons.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tp_cons.c,v 1.4 2001/06/25 01:50:17 fgsch Exp $ */ +/* $OpenBSD: tp_cons.c,v 1.5 2001/06/27 03:49:54 angelos Exp $ */ /* $NetBSD: tp_cons.c,v 1.8 1996/02/14 21:32:37 christos Exp $ */ /*- @@ -300,7 +300,7 @@ tpcons_output(m0, va_alist) MGETHDR(m, M_DONTWAIT, MT_DATA); if (m == 0) return ENOBUFS; - M_COPY_HDR(m, m0); + M_MOVE_HDR(m, m0); m->m_next = m0; } m->m_pkthdr.len = datalen; diff --git a/sys/netiso/tp_inet.c b/sys/netiso/tp_inet.c index 63eba45b903..72f1a429d12 100644 --- a/sys/netiso/tp_inet.c +++ b/sys/netiso/tp_inet.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tp_inet.c,v 1.5 2001/06/25 01:50:17 fgsch Exp $ */ +/* $OpenBSD: tp_inet.c,v 1.6 2001/06/27 03:49:54 angelos Exp $ */ /* $NetBSD: tp_inet.c,v 1.11 1996/03/16 23:13:49 christos Exp $ */ /*- @@ -454,7 +454,7 @@ tpip_output_dg(m0, va_alist) error = ENOBUFS; goto bad; } - M_COPY_HDR(m, m0); + M_MOVE_HDR(m, m0); m->m_next = m0; MH_ALIGN(m, sizeof(struct ip)); m->m_len = sizeof(struct ip); diff --git a/sys/netiso/tuba_subr.c b/sys/netiso/tuba_subr.c index e91a1f86e18..a70cdeab30b 100644 --- a/sys/netiso/tuba_subr.c +++ b/sys/netiso/tuba_subr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tuba_subr.c,v 1.8 2001/06/25 02:57:23 angelos Exp $ */ +/* $OpenBSD: tuba_subr.c,v 1.9 2001/06/27 03:49:55 angelos Exp $ */ /* $NetBSD: tuba_subr.c,v 1.7 1996/02/13 22:12:32 christos Exp $ */ /* @@ -329,7 +329,7 @@ tuba_tcpinput(m, va_alist) m = m0; goto drop; } - M_COPY_PKTHDR(m, m0); + M_MOVE_PKTHDR(m, m0); m->m_next = m0; m->m_data += max_linkhdr; if (len < sizeof(struct tcphdr)) { diff --git a/sys/netns/ns_ip.c b/sys/netns/ns_ip.c index 5d2de76cc2e..47b25f59825 100644 --- a/sys/netns/ns_ip.c +++ b/sys/netns/ns_ip.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ns_ip.c,v 1.13 2001/06/25 01:50:18 fgsch Exp $ */ +/* $OpenBSD: ns_ip.c,v 1.14 2001/06/27 03:49:55 angelos Exp $ */ /* $NetBSD: ns_ip.c,v 1.16 1996/05/09 22:29:40 scottr Exp $ */ /* @@ -285,7 +285,7 @@ nsipoutput(ifp, m, dst, rt) m_freem(m); return (ENOBUFS); } - M_COPY_HDR(m0, m); + M_MOVE_HDR(m0, m); MH_ALIGN(m0, sizeof (struct ip)); m0->m_flags = m->m_flags & M_COPYFLAGS; m0->m_next = m; diff --git a/sys/netns/spp_usrreq.c b/sys/netns/spp_usrreq.c index 522d472c8b7..97f83bd067c 100644 --- a/sys/netns/spp_usrreq.c +++ b/sys/netns/spp_usrreq.c @@ -1,4 +1,4 @@ -/* $OpenBSD: spp_usrreq.c,v 1.10 2001/06/25 01:50:18 fgsch Exp $ */ +/* $OpenBSD: spp_usrreq.c,v 1.11 2001/06/27 03:49:55 angelos Exp $ */ /* $NetBSD: spp_usrreq.c,v 1.9 1996/02/13 22:14:13 christos Exp $ */ /* @@ -848,7 +848,7 @@ spp_output(m0, va_alist) * Fill in mbuf with extended SP header * and addresses and length put into network format. */ - M_COPY_HDR(m, m0); + M_MOVE_HDR(m, m0); MH_ALIGN(m, sizeof (struct spidp)); m->m_len = sizeof (struct spidp); m->m_next = m0; diff --git a/sys/sys/mbuf.h b/sys/sys/mbuf.h index d744599ede4..ed3d948784f 100644 --- a/sys/sys/mbuf.h +++ b/sys/sys/mbuf.h @@ -1,4 +1,4 @@ -/* $OpenBSD: mbuf.h,v 1.47 2001/06/25 05:40:20 angelos Exp $ */ +/* $OpenBSD: mbuf.h,v 1.48 2001/06/27 03:49:55 angelos Exp $ */ /* $NetBSD: mbuf.h,v 1.19 1996/02/09 18:25:14 christos Exp $ */ /* @@ -410,10 +410,10 @@ void _sk_mclget(struct mbuf *, int); ) /* - * Copy just m_pkthdr from from to to, + * Move just m_pkthdr from from to to, * remove M_PKTHDR and clean the tag for from. */ -#define M_COPY_HDR(to, from) { \ +#define M_MOVE_HDR(to, from) { \ (to)->m_pkthdr = (from)->m_pkthdr; \ (from)->m_flags &= ~M_PKTHDR; \ SLIST_INIT(&(from)->m_pkthdr.tags); \ @@ -439,12 +439,12 @@ void _sk_mclget(struct mbuf *, int); } /* - * Copy mbuf pkthdr from from to to. + * MOVE mbuf pkthdr from from to to. * from must have M_PKTHDR set, and to must be empty. */ -#define M_COPY_PKTHDR(to, from) { \ +#define M_MOVE_PKTHDR(to, from) { \ (to)->m_flags = (from)->m_flags & M_COPYFLAGS; \ - M_COPY_HDR((to), (from)); \ + M_MOVE_HDR((to), (from)); \ (to)->m_data = (to)->m_pktdat; \ } @@ -456,7 +456,7 @@ void _sk_mclget(struct mbuf *, int); { (m)->m_data += (MLEN - (len)) &~ (sizeof(long) - 1); } /* * As above, for mbufs allocated with m_gethdr/MGETHDR - * or initialized by M_COPY_PKTHDR. + * or initialized by M_MOVE_PKTHDR. */ #define MH_ALIGN(m, len) \ { (m)->m_data += (MHLEN - (len)) &~ (sizeof(long) - 1); } |