Skip to content

Commit

Permalink
fixed an endian bug on fragment header scanning
Browse files Browse the repository at this point in the history
Reported by  Masahito Endo <masaxmasa@tahi.org>
  • Loading branch information
suz committed Oct 10, 2003
1 parent 1bbf097 commit f4022e3
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions kame/sys/netinet6/ip6_input.c
@@ -1,4 +1,4 @@
/* $KAME: ip6_input.c,v 1.330 2003/09/21 09:33:42 jinmei Exp $ */
/* $KAME: ip6_input.c,v 1.331 2003/10/10 13:58:00 suz Exp $ */

/*
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
Expand Down Expand Up @@ -2103,7 +2103,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;
Expand Down

0 comments on commit f4022e3

Please sign in to comment.