1
0
mirror of https://git.FreeBSD.org/src.git synced 2025-01-28 16:43:09 +00:00

M_COPY_PKTHDR has to be done before MCLGET.

Obtained from:	KAME
This commit is contained in:
Hajimu UMEMOTO 2001-05-22 17:32:02 +00:00
parent 7b9ca2bd8c
commit 8d67252492
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=77003

View File

@ -279,6 +279,8 @@ ip6_input(m)
struct mbuf *n;
MGETHDR(n, M_DONTWAIT, MT_HEADER);
if (n)
M_COPY_PKTHDR(n, m);
if (n && m->m_pkthdr.len > MHLEN) {
MCLGET(n, M_DONTWAIT);
if ((n->m_flags & M_EXT) == 0) {
@ -286,14 +288,13 @@ ip6_input(m)
n = NULL;
}
}
if (!n)
if (!n) {
m_freem(m);
return; /*ENOBUFS*/
}
m_copydata(m, 0, m->m_pkthdr.len, mtod(n, caddr_t));
n->m_pkthdr = m->m_pkthdr;
n->m_len = m->m_pkthdr.len;
n->m_pkthdr.aux = m->m_pkthdr.aux;
m->m_pkthdr.aux = (struct mbuf *)NULL;
m_freem(m);
m = n;
}