version 1.46, 2001/10/29 07:02:35 |
version 1.50, 2001/12/21 03:58:15 |
|
|
* @(#)ip_input.c 8.2 (Berkeley) 1/4/94 |
* @(#)ip_input.c 8.2 (Berkeley) 1/4/94 |
*/ |
*/ |
|
|
|
#include <sys/cdefs.h> |
|
__KERNEL_RCSID(0, "$NetBSD$"); |
|
|
#include "opt_inet.h" |
#include "opt_inet.h" |
#include "opt_ipsec.h" |
#include "opt_ipsec.h" |
#include "opt_pfil_hooks.h" |
#include "opt_pfil_hooks.h" |
|
|
#include "gif.h" |
#include "gif.h" |
#include "bpfilter.h" |
#include "bpfilter.h" |
|
|
|
#if NGIF > 0 |
|
#include <netinet6/in6_gif.h> |
|
#endif |
|
|
#include <net/net_osdep.h> |
#include <net/net_osdep.h> |
|
|
extern struct domain inet6domain; |
extern struct domain inet6domain; |
|
|
* should the inner packet be considered authentic? |
* should the inner packet be considered authentic? |
* see comment in ah4_input(). |
* see comment in ah4_input(). |
*/ |
*/ |
if (m) { |
m->m_flags &= ~M_AUTHIPHDR; |
m->m_flags &= ~M_AUTHIPHDR; |
m->m_flags &= ~M_AUTHIPDGM; |
m->m_flags &= ~M_AUTHIPDGM; |
|
} |
|
#endif |
#endif |
|
|
/* |
/* |
|
|
ip6 = mtod(m, struct ip6_hdr *); |
ip6 = mtod(m, struct ip6_hdr *); |
|
|
/* |
/* |
* if the payload length field is 0 and the next header field |
* if the payload length field is 0 and the next header field |
* indicates Hop-by-Hop Options header, then a Jumbo Payload |
* indicates Hop-by-Hop Options header, then a Jumbo Payload |
* option MUST be included. |
* option MUST be included. |
*/ |
*/ |
Line 1321 ip6_nexthdr(m, off, proto, nxtp) |
|
Line 1326 ip6_nexthdr(m, off, proto, nxtp) |
|
if (nxtp) |
if (nxtp) |
*nxtp = ip6e.ip6e_nxt; |
*nxtp = ip6e.ip6e_nxt; |
off += (ip6e.ip6e_len + 2) << 2; |
off += (ip6e.ip6e_len + 2) << 2; |
|
if (m->m_pkthdr.len < off) |
|
return -1; |
return off; |
return off; |
|
|
case IPPROTO_HOPOPTS: |
case IPPROTO_HOPOPTS: |
Line 1332 ip6_nexthdr(m, off, proto, nxtp) |
|
Line 1339 ip6_nexthdr(m, off, proto, nxtp) |
|
if (nxtp) |
if (nxtp) |
*nxtp = ip6e.ip6e_nxt; |
*nxtp = ip6e.ip6e_nxt; |
off += (ip6e.ip6e_len + 1) << 3; |
off += (ip6e.ip6e_len + 1) << 3; |
|
if (m->m_pkthdr.len < off) |
|
return -1; |
return off; |
return off; |
|
|
case IPPROTO_NONE: |
case IPPROTO_NONE: |