version 1.81, 2006/01/21 00:15:36 |
version 1.82.2.1, 2006/02/07 04:58:11 |
Line 94 __KERNEL_RCSID(0, "$NetBSD$"); |
|
Line 94 __KERNEL_RCSID(0, "$NetBSD$"); |
|
|
|
#include <netinet/in.h> |
#include <netinet/in.h> |
#include <netinet/in_systm.h> |
#include <netinet/in_systm.h> |
|
#include <netinet/in_pcb.h> |
#ifdef INET |
#ifdef INET |
#include <netinet/ip.h> |
#include <netinet/ip.h> |
#include <netinet/ip_icmp.h> |
#include <netinet/ip_icmp.h> |
Line 101 __KERNEL_RCSID(0, "$NetBSD$"); |
|
Line 102 __KERNEL_RCSID(0, "$NetBSD$"); |
|
#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> |
#include <netinet6/in6_pcb.h> |
|
#include <netinet/icmp6.h> |
#include <netinet/icmp6.h> |
#include <netinet6/scope6_var.h> |
#include <netinet6/scope6_var.h> |
#include <netinet6/in6_ifattach.h> |
#include <netinet6/in6_ifattach.h> |
|
|
goto bad; |
goto bad; |
} |
} |
|
|
/* |
|
* Disambiguate address scope zones (if there is ambiguity). |
|
* We first make sure that the original source or destination address |
|
* is not in our internal form for scoped addresses. Such addresses |
|
* are not necessarily invalid spec-wise, but we cannot accept them due |
|
* to the usage conflict. |
|
* in6_setscope() then also checks and rejects the cases where src or |
|
* dst are the loopback address and the receiving interface |
|
* is not loopback. |
|
*/ |
|
if (in6_clearscope(&ip6->ip6_src) || in6_clearscope(&ip6->ip6_dst)) { |
|
ip6stat.ip6s_badscope++; /* XXX */ |
|
goto bad; |
|
} |
|
if (in6_setscope(&ip6->ip6_src, m->m_pkthdr.rcvif, NULL) || |
|
in6_setscope(&ip6->ip6_dst, m->m_pkthdr.rcvif, NULL)) { |
|
ip6stat.ip6s_badscope++; |
|
goto bad; |
|
} |
|
|
|
#ifdef PFIL_HOOKS |
#ifdef PFIL_HOOKS |
/* |
/* |
* Run through list of hooks for input packets. If there are any |
* Run through list of hooks for input packets. If there are any |
|
|
#endif |
#endif |
|
|
/* |
/* |
|
* Disambiguate address scope zones (if there is ambiguity). |
|
* We first make sure that the original source or destination address |
|
* is not in our internal form for scoped addresses. Such addresses |
|
* are not necessarily invalid spec-wise, but we cannot accept them due |
|
* to the usage conflict. |
|
* in6_setscope() then also checks and rejects the cases where src or |
|
* dst are the loopback address and the receiving interface |
|
* is not loopback. |
|
*/ |
|
if (in6_clearscope(&ip6->ip6_src) || in6_clearscope(&ip6->ip6_dst)) { |
|
ip6stat.ip6s_badscope++; /* XXX */ |
|
goto bad; |
|
} |
|
if (in6_setscope(&ip6->ip6_src, m->m_pkthdr.rcvif, NULL) || |
|
in6_setscope(&ip6->ip6_dst, m->m_pkthdr.rcvif, NULL)) { |
|
ip6stat.ip6s_badscope++; |
|
goto bad; |
|
} |
|
|
|
/* |
* Multicast check |
* Multicast check |
*/ |
*/ |
if (IN6_IS_ADDR_MULTICAST(&ip6->ip6_dst)) { |
if (IN6_IS_ADDR_MULTICAST(&ip6->ip6_dst)) { |