diff options
author | Federico G. Schwindt <fgsch@cvs.openbsd.org> | 2001-06-25 01:50:19 +0000 |
---|---|---|
committer | Federico G. Schwindt <fgsch@cvs.openbsd.org> | 2001-06-25 01:50:19 +0000 |
commit | f642fb2e9a5edbb5c8e001aab6f8d051ccfd10ac (patch) | |
tree | 9ab160bd7df1a0dede4fbd84f86a4e072d37817a | |
parent | a10f9958afb69fd8b8735a135507dcf7ace599cb (diff) |
Move common post M_COPY_HDR manipulation to the macro itself; angelos@ ok.
-rw-r--r-- | sys/kern/uipc_mbuf.c | 7 | ||||
-rw-r--r-- | sys/net/if_gre.c | 4 | ||||
-rw-r--r-- | sys/net/if_ppp.c | 7 | ||||
-rw-r--r-- | sys/netccitt/if_x25subr.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/netns/ns_ip.c | 4 | ||||
-rw-r--r-- | sys/netns/spp_usrreq.c | 4 | ||||
-rw-r--r-- | sys/sys/mbuf.h | 7 |
11 files changed, 18 insertions, 35 deletions
diff --git a/sys/kern/uipc_mbuf.c b/sys/kern/uipc_mbuf.c index 981134928e4..b303fb8bafc 100644 --- a/sys/kern/uipc_mbuf.c +++ b/sys/kern/uipc_mbuf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uipc_mbuf.c,v 1.34 2001/05/26 06:59:14 angelos Exp $ */ +/* $OpenBSD: uipc_mbuf.c,v 1.35 2001/06/25 01:50:16 fgsch Exp $ */ /* $NetBSD: uipc_mbuf.c,v 1.15.4.1 1996/06/13 17:11:44 cgd Exp $ */ /* @@ -664,11 +664,10 @@ m_pullup2(n, len) goto bad; m->m_len = 0; if (n->m_flags & M_PKTHDR) { - /* M_COPY_PKTHDR(m, n);*//* Too many adverse side effects. */ + /* Too many adverse side effects. */ + /* M_COPY_PKTHDR(m, n); */ M_COPY_HDR(m, n); m->m_flags = (n->m_flags & M_COPYFLAGS) | M_EXT; - n->m_flags &= ~M_PKTHDR; - m_tag_init(n); /* n->m_data is cool. */ } } diff --git a/sys/net/if_gre.c b/sys/net/if_gre.c index e7a07d162e6..0386437295f 100644 --- a/sys/net/if_gre.c +++ b/sys/net/if_gre.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_gre.c,v 1.13 2001/06/22 14:28:58 deraadt Exp $ */ +/* $OpenBSD: if_gre.c,v 1.14 2001/06/25 01:50:16 fgsch Exp $ */ /* $NetBSD: if_gre.c,v 1.9 1999/10/25 19:18:11 drochner Exp $ */ /* @@ -254,8 +254,6 @@ gre_output(struct ifnet *ifp, struct mbuf *m, struct sockaddr *dst, return (ENOBUFS); } M_COPY_HDR(m0, m); - m_tag_init(m); - m->m_flags &= ~M_PKTHDR; 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 404431129b1..bd521d27fe8 100644 --- a/sys/net/if_ppp.c +++ b/sys/net/if_ppp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_ppp.c,v 1.20 2001/06/15 03:38:34 itojun Exp $ */ +/* $OpenBSD: if_ppp.c,v 1.21 2001/06/25 01:50:17 fgsch Exp $ */ /* $NetBSD: if_ppp.c,v 1.39 1997/05/17 21:11:59 christos Exp $ */ /* @@ -1287,11 +1287,8 @@ ppp_inproc(sc, m) goto bad; /* lose if big headers and no clusters */ } } - if (m->m_flags & M_PKTHDR) { + if (m->m_flags & M_PKTHDR) M_COPY_HDR(mp, m); - m_tag_init(m); - m->m_flags &= ~M_PKTHDR; - } cp = mtod(mp, u_char *); cp[0] = adrs; cp[1] = ctrl; diff --git a/sys/netccitt/if_x25subr.c b/sys/netccitt/if_x25subr.c index ebdb3b243a4..8e3ea1edaeb 100644 --- a/sys/netccitt/if_x25subr.c +++ b/sys/netccitt/if_x25subr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_x25subr.c,v 1.7 2001/06/15 03:38:35 itojun Exp $ */ +/* $OpenBSD: if_x25subr.c,v 1.8 2001/06/25 01:50:17 fgsch Exp $ */ /* $NetBSD: if_x25subr.c,v 1.13 1996/05/09 22:29:25 scottr Exp $ */ /* @@ -346,8 +346,6 @@ x25_ifoutput(ifp, m0, dst, rt) if (m == 0) senderr(ENOBUFS); M_COPY_HDR(m, m0); - m_tag_init(m0); - m0->m_flags &= ~M_PKTHDR; m->m_pkthdr.len = plen; m->m_next = m0; } diff --git a/sys/netipx/spx_usrreq.c b/sys/netipx/spx_usrreq.c index 9560c6e1e20..3b70328ebde 100644 --- a/sys/netipx/spx_usrreq.c +++ b/sys/netipx/spx_usrreq.c @@ -1,4 +1,4 @@ -/* $OpenBSD: spx_usrreq.c,v 1.14 2001/05/27 12:16:01 angelos Exp $ */ +/* $OpenBSD: spx_usrreq.c,v 1.15 2001/06/25 01:50:17 fgsch Exp $ */ /*- * @@ -799,8 +799,6 @@ spx_output(cb, m0) * and addresses and length put into network format. */ M_COPY_HDR(m, m0); - m_tag_init(m0); - m0->m_flags &= ~M_PKTHDR; 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 4dafeb473cf..d012293f851 100644 --- a/sys/netiso/if_eon.c +++ b/sys/netiso/if_eon.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_eon.c,v 1.11 2001/06/15 03:38:35 itojun Exp $ */ +/* $OpenBSD: if_eon.c,v 1.12 2001/06/25 01:50:17 fgsch Exp $ */ /* $NetBSD: if_eon.c,v 1.15 1996/05/09 22:29:37 scottr Exp $ */ /*- @@ -417,8 +417,6 @@ send: if (mh == (struct mbuf *) 0) goto flush; M_COPY_HDR(mh, m); - m->m_flags &= ~M_PKTHDR; - m_tag_init(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 6147aa58555..fdd833f4741 100644 --- a/sys/netiso/tp_cons.c +++ b/sys/netiso/tp_cons.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tp_cons.c,v 1.3 2001/05/27 12:26:05 angelos Exp $ */ +/* $OpenBSD: tp_cons.c,v 1.4 2001/06/25 01:50:17 fgsch Exp $ */ /* $NetBSD: tp_cons.c,v 1.8 1996/02/14 21:32:37 christos Exp $ */ /*- @@ -301,8 +301,6 @@ tpcons_output(m0, va_alist) if (m == 0) return ENOBUFS; M_COPY_HDR(m, m0); - m_tag_init(m0); - m0->m_flags &= ~M_PKTHDR; m->m_next = m0; } m->m_pkthdr.len = datalen; diff --git a/sys/netiso/tp_inet.c b/sys/netiso/tp_inet.c index c1a917568ff..63eba45b903 100644 --- a/sys/netiso/tp_inet.c +++ b/sys/netiso/tp_inet.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tp_inet.c,v 1.4 2001/05/27 12:26:05 angelos Exp $ */ +/* $OpenBSD: tp_inet.c,v 1.5 2001/06/25 01:50:17 fgsch Exp $ */ /* $NetBSD: tp_inet.c,v 1.11 1996/03/16 23:13:49 christos Exp $ */ /*- @@ -455,8 +455,6 @@ tpip_output_dg(m0, va_alist) goto bad; } M_COPY_HDR(m, m0); - m_tag_init(m0); - m0->m_flags &= ~M_PKTHDR; m->m_next = m0; MH_ALIGN(m, sizeof(struct ip)); m->m_len = sizeof(struct ip); diff --git a/sys/netns/ns_ip.c b/sys/netns/ns_ip.c index 4d136b90099..5d2de76cc2e 100644 --- a/sys/netns/ns_ip.c +++ b/sys/netns/ns_ip.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ns_ip.c,v 1.12 2001/05/27 12:29:23 angelos Exp $ */ +/* $OpenBSD: ns_ip.c,v 1.13 2001/06/25 01:50:18 fgsch Exp $ */ /* $NetBSD: ns_ip.c,v 1.16 1996/05/09 22:29:40 scottr Exp $ */ /* @@ -286,8 +286,6 @@ nsipoutput(ifp, m, dst, rt) return (ENOBUFS); } M_COPY_HDR(m0, m); - m->m_flags &= ~M_PKTHDR; - m_tag_init(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 ca691744b84..522d472c8b7 100644 --- a/sys/netns/spp_usrreq.c +++ b/sys/netns/spp_usrreq.c @@ -1,4 +1,4 @@ -/* $OpenBSD: spp_usrreq.c,v 1.9 2001/05/27 12:29:23 angelos Exp $ */ +/* $OpenBSD: spp_usrreq.c,v 1.10 2001/06/25 01:50:18 fgsch Exp $ */ /* $NetBSD: spp_usrreq.c,v 1.9 1996/02/13 22:14:13 christos Exp $ */ /* @@ -849,8 +849,6 @@ spp_output(m0, va_alist) * and addresses and length put into network format. */ M_COPY_HDR(m, m0); - m0->m_flags &= ~M_PKTHDR; - m_tag_init(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 518e96a0cb8..ab1620545aa 100644 --- a/sys/sys/mbuf.h +++ b/sys/sys/mbuf.h @@ -1,4 +1,4 @@ -/* $OpenBSD: mbuf.h,v 1.42 2001/06/23 04:39:35 angelos Exp $ */ +/* $OpenBSD: mbuf.h,v 1.43 2001/06/25 01:50:18 fgsch Exp $ */ /* $NetBSD: mbuf.h,v 1.19 1996/02/09 18:25:14 christos Exp $ */ /* @@ -410,10 +410,13 @@ void _sk_mclget(struct mbuf *, int); ) /* - * Copy just m_pkthdr from from to to. + * Copy just m_pkthdr from from to to, + * remove M_PKTHDR and clean the tag for from. */ #define M_COPY_HDR(to, from) { \ (to)->m_pkthdr = (from)->m_pkthdr; \ + (from)->m_flags &= ~M_PKTHDR; \ + m_tag_init((from)); \ } /* |