version 1.37.2.8, 2002/01/08 00:34:19 |
version 1.44, 2001/10/16 06:24:44 |
|
|
* @(#)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" |
Line 84 __KERNEL_RCSID(0, "$NetBSD$"); |
|
Line 81 __KERNEL_RCSID(0, "$NetBSD$"); |
|
#include <sys/time.h> |
#include <sys/time.h> |
#include <sys/kernel.h> |
#include <sys/kernel.h> |
#include <sys/syslog.h> |
#include <sys/syslog.h> |
#include <sys/lwp.h> |
|
#include <sys/proc.h> |
#include <sys/proc.h> |
#include <sys/sysctl.h> |
|
|
|
#include <net/if.h> |
#include <net/if.h> |
#include <net/if_types.h> |
#include <net/if_types.h> |
Line 102 __KERNEL_RCSID(0, "$NetBSD$"); |
|
Line 97 __KERNEL_RCSID(0, "$NetBSD$"); |
|
#ifdef INET |
#ifdef INET |
#include <netinet/ip.h> |
#include <netinet/ip.h> |
#include <netinet/ip_icmp.h> |
#include <netinet/ip_icmp.h> |
#endif /* INET */ |
#endif /*INET*/ |
#include <netinet/ip6.h> |
#include <netinet/ip6.h> |
#include <netinet6/in6_var.h> |
#include <netinet6/in6_var.h> |
#include <netinet6/ip6_var.h> |
#include <netinet6/ip6_var.h> |
Line 121 __KERNEL_RCSID(0, "$NetBSD$"); |
|
Line 116 __KERNEL_RCSID(0, "$NetBSD$"); |
|
/* we need it for NLOOP. */ |
/* we need it for NLOOP. */ |
#include "loop.h" |
#include "loop.h" |
#include "faith.h" |
#include "faith.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(). |
*/ |
*/ |
m->m_flags &= ~M_AUTHIPHDR; |
if (m) { |
m->m_flags &= ~M_AUTHIPDGM; |
m->m_flags &= ~M_AUTHIPHDR; |
|
m->m_flags &= ~M_AUTHIPDGM; |
|
} |
#endif |
#endif |
|
|
/* |
/* |
|
|
&& ip6_forward_rt.ro_rt->rt_ifp->if_type == IFT_FAITH) { |
&& ip6_forward_rt.ro_rt->rt_ifp->if_type == IFT_FAITH) { |
/* XXX do we need more sanity checks? */ |
/* XXX do we need more sanity checks? */ |
ours = 1; |
ours = 1; |
deliverifp = ip6_forward_rt.ro_rt->rt_ifp; /* faith */ |
deliverifp = ip6_forward_rt.ro_rt->rt_ifp; /*faith*/ |
goto hbhcheck; |
goto hbhcheck; |
} |
} |
} |
} |
|
|
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 1012 ip6_savecontrol(in6p, mp, ip6, m) |
|
Line 1006 ip6_savecontrol(in6p, mp, ip6, m) |
|
struct ip6_hdr *ip6; |
struct ip6_hdr *ip6; |
struct mbuf *m; |
struct mbuf *m; |
{ |
{ |
struct proc *p = (curproc ? curproc->l_proc : 0); /* XXX */ |
struct proc *p = curproc; /* XXX */ |
int privileged; |
int privileged; |
|
|
privileged = 0; |
privileged = 0; |
Line 1327 ip6_nexthdr(m, off, proto, nxtp) |
|
Line 1321 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 1340 ip6_nexthdr(m, off, proto, nxtp) |
|
Line 1332 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: |
Line 1401 u_char inet6ctlerrmap[PRC_NCMDS] = { |
|
Line 1391 u_char inet6ctlerrmap[PRC_NCMDS] = { |
|
ENOPROTOOPT |
ENOPROTOOPT |
}; |
}; |
|
|
|
#include <uvm/uvm_extern.h> |
|
#include <sys/sysctl.h> |
|
|
int |
int |
ip6_sysctl(name, namelen, oldp, oldlenp, newp, newlen) |
ip6_sysctl(name, namelen, oldp, oldlenp, newp, newlen) |
int *name; |
int *name; |
Line 1448 ip6_sysctl(name, namelen, oldp, oldlenp, |
|
Line 1441 ip6_sysctl(name, namelen, oldp, oldlenp, |
|
case IPV6CTL_DEFMCASTHLIM: |
case IPV6CTL_DEFMCASTHLIM: |
return sysctl_int(oldp, oldlenp, newp, newlen, |
return sysctl_int(oldp, oldlenp, newp, newlen, |
&ip6_defmcasthlim); |
&ip6_defmcasthlim); |
#if NGIF > 0 |
|
case IPV6CTL_GIF_HLIM: |
case IPV6CTL_GIF_HLIM: |
return sysctl_int(oldp, oldlenp, newp, newlen, |
return sysctl_int(oldp, oldlenp, newp, newlen, |
&ip6_gif_hlim); |
&ip6_gif_hlim); |
#endif |
|
case IPV6CTL_KAME_VERSION: |
case IPV6CTL_KAME_VERSION: |
return sysctl_rdstring(oldp, oldlenp, newp, __KAME_VERSION); |
return sysctl_rdstring(oldp, oldlenp, newp, __KAME_VERSION); |
case IPV6CTL_USE_DEPRECATED: |
case IPV6CTL_USE_DEPRECATED: |