diff options
author | ume <ume@FreeBSD.org> | 2001-05-22 17:32:02 +0000 |
---|---|---|
committer | ume <ume@FreeBSD.org> | 2001-05-22 17:32:02 +0000 |
commit | 24ad56d2edb8c1e87197afc2d16e6dbe5acd0d6c (patch) | |
tree | 486ff4e4fdc4ab954afaff9549ec1f3b3287c81b | |
parent | 1288dc13bea21bab38fd813b22533cbe0379b980 (diff) | |
download | FreeBSD-src-24ad56d2edb8c1e87197afc2d16e6dbe5acd0d6c.zip FreeBSD-src-24ad56d2edb8c1e87197afc2d16e6dbe5acd0d6c.tar.gz |
M_COPY_PKTHDR has to be done before MCLGET.
Obtained from: KAME
-rw-r--r-- | sys/netinet6/ip6_input.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/sys/netinet6/ip6_input.c b/sys/netinet6/ip6_input.c index 01056bb..4745347 100644 --- a/sys/netinet6/ip6_input.c +++ b/sys/netinet6/ip6_input.c @@ -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; } |