Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

fixed an endian bug on fragment header scanning

Reported by  Masahito Endo <masaxmasa@tahi.org>
  • Loading branch information...
commit f4022e3ec8a4941fe4c8b9abc8e7e7d1ea340aa3 1 parent 1bbf097
suz authored
Showing with 3 additions and 2 deletions.
  1. +3 −2 kame/sys/netinet6/ip6_input.c
View
5 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.
@@ -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;
Please sign in to comment.
Something went wrong with that request. Please try again.