Deleted Added
full compact
uipc_mbuf.c (112185) uipc_mbuf.c (112733)
1/*
2 * Copyright (c) 1982, 1986, 1988, 1991, 1993
3 * The Regents of the University of California. All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 17 unchanged lines hidden (view full) ---

26 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
27 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
28 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31 * SUCH DAMAGE.
32 *
33 * @(#)uipc_mbuf.c 8.2 (Berkeley) 1/4/94
1/*
2 * Copyright (c) 1982, 1986, 1988, 1991, 1993
3 * The Regents of the University of California. All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 17 unchanged lines hidden (view full) ---

26 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
27 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
28 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31 * SUCH DAMAGE.
32 *
33 * @(#)uipc_mbuf.c 8.2 (Berkeley) 1/4/94
34 * $FreeBSD: head/sys/kern/uipc_mbuf.c 112185 2003-03-13 09:02:19Z iedowse $
34 * $FreeBSD: head/sys/kern/uipc_mbuf.c 112733 2003-03-28 05:57:48Z silby $
35 */
36
37#include "opt_mac.h"
38#include "opt_param.h"
39
40#include <sys/param.h>
41#include <sys/systm.h>
42#include <sys/kernel.h>

--- 68 unchanged lines hidden (view full) ---

111 * when the mbuf is allocated with MGETHDR. Many users
112 * (e.g. m_copy*, m_prepend) use MGET and then
113 * smash the pkthdr as needed causing these
114 * assertions to trip. For now just disable them.
115 */
116 KASSERT(to->m_flags & M_PKTHDR, ("m_dup_pkthdr: called on non-header"));
117 KASSERT(SLIST_EMPTY(&to->m_pkthdr.tags), ("m_dup_pkthdr: to has tags"));
118#endif
35 */
36
37#include "opt_mac.h"
38#include "opt_param.h"
39
40#include <sys/param.h>
41#include <sys/systm.h>
42#include <sys/kernel.h>

--- 68 unchanged lines hidden (view full) ---

111 * when the mbuf is allocated with MGETHDR. Many users
112 * (e.g. m_copy*, m_prepend) use MGET and then
113 * smash the pkthdr as needed causing these
114 * assertions to trip. For now just disable them.
115 */
116 KASSERT(to->m_flags & M_PKTHDR, ("m_dup_pkthdr: called on non-header"));
117 KASSERT(SLIST_EMPTY(&to->m_pkthdr.tags), ("m_dup_pkthdr: to has tags"));
118#endif
119 KASSERT((to->m_flags & M_EXT) == 0, ("m_dup_pkthdr: to has cluster"));
120#ifdef MAC
121 if (to->m_flags & M_PKTHDR)
122 mac_destroy_mbuf(to);
123#endif
119#ifdef MAC
120 if (to->m_flags & M_PKTHDR)
121 mac_destroy_mbuf(to);
122#endif
124 to->m_flags = from->m_flags & M_COPYFLAGS;
125 to->m_data = to->m_pktdat;
123 to->m_flags = (from->m_flags & M_COPYFLAGS) | (to->m_flags & M_EXT);
124 if ((to->m_flags & M_EXT) == 0)
125 to->m_data = to->m_pktdat;
126 to->m_pkthdr = from->m_pkthdr;
127#ifdef MAC
128 mac_init_mbuf(to, 1); /* XXXMAC no way to fail */
129 mac_create_mbuf_from_mbuf(from, to);
130#endif
131 SLIST_INIT(&to->m_pkthdr.tags);
132 return (m_tag_copy_chain(to, from, (how & M_TRYWAIT) ? M_WAITOK :
133 M_NOWAIT));

--- 647 unchanged lines hidden ---
126 to->m_pkthdr = from->m_pkthdr;
127#ifdef MAC
128 mac_init_mbuf(to, 1); /* XXXMAC no way to fail */
129 mac_create_mbuf_from_mbuf(from, to);
130#endif
131 SLIST_INIT(&to->m_pkthdr.tags);
132 return (m_tag_copy_chain(to, from, (how & M_TRYWAIT) ? M_WAITOK :
133 M_NOWAIT));

--- 647 unchanged lines hidden ---