Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. =================================================================== RCS file: /ftp/cvs/cvsroot/src/sys/netinet6/ip6_input.c,v rcsdiff: /ftp/cvs/cvsroot/src/sys/netinet6/ip6_input.c,v: warning: Unknown phrases like `commitid ...;' are present. retrieving revision 1.37.2.6 retrieving revision 1.37.2.7 diff -u -p -r1.37.2.6 -r1.37.2.7 --- src/sys/netinet6/ip6_input.c 2001/10/22 20:42:02 1.37.2.6 +++ src/sys/netinet6/ip6_input.c 2001/11/14 19:18:09 1.37.2.7 @@ -1,4 +1,4 @@ -/* $NetBSD: ip6_input.c,v 1.37.2.6 2001/10/22 20:42:02 nathanw Exp $ */ +/* $NetBSD: ip6_input.c,v 1.37.2.7 2001/11/14 19:18:09 nathanw Exp $ */ /* $KAME: ip6_input.c,v 1.188 2001/03/29 05:34:31 itojun Exp $ */ /* @@ -65,6 +65,9 @@ * @(#)ip_input.c 8.2 (Berkeley) 1/4/94 */ +#include +__KERNEL_RCSID(0, "$NetBSD: ip6_input.c,v 1.37.2.7 2001/11/14 19:18:09 nathanw Exp $"); + #include "opt_inet.h" #include "opt_ipsec.h" #include "opt_pfil_hooks.h" @@ -83,6 +86,7 @@ #include #include #include +#include #include #include @@ -98,7 +102,7 @@ #ifdef INET #include #include -#endif /*INET*/ +#endif /* INET */ #include #include #include @@ -117,7 +121,6 @@ /* we need it for NLOOP. */ #include "loop.h" #include "faith.h" - #include "gif.h" #include "bpfilter.h" @@ -542,7 +545,7 @@ ip6_input(m) && ip6_forward_rt.ro_rt->rt_ifp->if_type == IFT_FAITH) { /* XXX do we need more sanity checks? */ ours = 1; - deliverifp = ip6_forward_rt.ro_rt->rt_ifp; /*faith*/ + deliverifp = ip6_forward_rt.ro_rt->rt_ifp; /* faith */ goto hbhcheck; } } @@ -1322,6 +1325,8 @@ ip6_nexthdr(m, off, proto, nxtp) if (nxtp) *nxtp = ip6e.ip6e_nxt; off += (ip6e.ip6e_len + 2) << 2; + if (m->m_pkthdr.len < off) + return -1; return off; case IPPROTO_HOPOPTS: @@ -1333,6 +1338,8 @@ ip6_nexthdr(m, off, proto, nxtp) if (nxtp) *nxtp = ip6e.ip6e_nxt; off += (ip6e.ip6e_len + 1) << 3; + if (m->m_pkthdr.len < off) + return -1; return off; case IPPROTO_NONE: @@ -1392,9 +1399,6 @@ u_char inet6ctlerrmap[PRC_NCMDS] = { ENOPROTOOPT }; -#include -#include - int ip6_sysctl(name, namelen, oldp, oldlenp, newp, newlen) int *name;