1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-23 11:18:54 +00:00

fixed an endian bug on fragment header scanning

Obtained from:	KAME
This commit is contained in:
Hajimu UMEMOTO 2003-10-10 19:49:52 +00:00
parent acc596e494
commit 020a816f9e
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=120978

View File

@ -1479,7 +1479,8 @@ ip6_nexthdr(m, off, proto, nxtp)
if (m->m_pkthdr.len < off + sizeof(fh))
return -1;
m_copydata(m, off, sizeof(fh), (caddr_t)&fh);
if ((ntohs(fh.ip6f_offlg) & IP6F_OFF_MASK) != 0)
/* IP6F_OFF_MASK = 0xfff8(BigEndian), 0xf8ff(LittleEndian) */
if (fh.ip6f_offlg & IP6F_OFF_MASK)
return -1;
if (nxtp)
*nxtp = fh.ip6f_nxt;