summaryrefslogtreecommitdiffstats
path: root/sys/netinet6
diff options
context:
space:
mode:
authorume <ume@FreeBSD.org>2006-01-25 08:17:02 +0000
committerume <ume@FreeBSD.org>2006-01-25 08:17:02 +0000
commita4f310a8a6e1abf18065ed71a19ffed4eb5141dd (patch)
tree2362488e3ac0482148c3360c5b7e739f4352786d /sys/netinet6
parentd1c7af5900900497c402aa73f383cf3da406ade2 (diff)
downloadFreeBSD-src-a4f310a8a6e1abf18065ed71a19ffed4eb5141dd.zip
FreeBSD-src-a4f310a8a6e1abf18065ed71a19ffed4eb5141dd.tar.gz
don't embed scope id before running packet filters.
Reported by: YAMAMOTO Takashi <yamt__at__mwd.biglobe.ne.jp> Obtained from: NetBSD MFC after: 1 week
Diffstat (limited to 'sys/netinet6')
-rw-r--r--sys/netinet6/ip6_input.c40
1 files changed, 20 insertions, 20 deletions
diff --git a/sys/netinet6/ip6_input.c b/sys/netinet6/ip6_input.c
index 757b1d1..3b34557 100644
--- a/sys/netinet6/ip6_input.c
+++ b/sys/netinet6/ip6_input.c
@@ -405,26 +405,6 @@ ip6_input(m)
#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;
- }
-
- /*
* Run through list of hooks for input packets.
*
* NB: Beware of the destination address changing
@@ -461,6 +441,26 @@ passin:
}
/*
+ * 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
*/
if (IN6_IS_ADDR_MULTICAST(&ip6->ip6_dst)) {
OpenPOWER on IntegriCloud