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.80.2.1 retrieving revision 1.81 diff -u -p -r1.80.2.1 -r1.81 --- src/sys/netinet6/ip6_input.c 2006/02/01 14:52:41 1.80.2.1 +++ src/sys/netinet6/ip6_input.c 2006/01/21 00:15:36 1.81 @@ -1,4 +1,4 @@ -/* $NetBSD: ip6_input.c,v 1.80.2.1 2006/02/01 14:52:41 yamt Exp $ */ +/* $NetBSD: ip6_input.c,v 1.81 2006/01/21 00:15:36 rpaulo Exp $ */ /* $KAME: ip6_input.c,v 1.188 2001/03/29 05:34:31 itojun Exp $ */ /* @@ -62,7 +62,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: ip6_input.c,v 1.80.2.1 2006/02/01 14:52:41 yamt Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ip6_input.c,v 1.81 2006/01/21 00:15:36 rpaulo Exp $"); #include "opt_inet.h" #include "opt_ipsec.h" @@ -298,6 +298,26 @@ ip6_input(m) 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 /* * Run through list of hooks for input packets. If there are any @@ -385,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; - } - - /* * Multicast check */ if (IN6_IS_ADDR_MULTICAST(&ip6->ip6_dst)) {