We don't embed zone index now, so we just can use in6_localip. --- sys/netpfil/ipfw/ip_fw2.c (svn+ssh://svn.freebsd.org/base/head) (revision 261548) +++ sys/netpfil/ipfw/ip_fw2.c (working copy) @@ -481,35 +481,7 @@ flow6id_match( int curr_flow, ipfw_insn_u32 *cmd ) return 0; } -/* support for IP6_*_ME opcodes */ static int -search_ip6_addr_net (struct in6_addr * ip6_addr) -{ - struct ifnet *mdc; - struct ifaddr *mdc2; - struct in6_ifaddr *fdm; - struct in6_addr copia; - - TAILQ_FOREACH(mdc, &V_ifnet, if_link) { - if_addr_rlock(mdc); - TAILQ_FOREACH(mdc2, &mdc->if_addrhead, ifa_link) { - if (mdc2->ifa_addr->sa_family == AF_INET6) { - fdm = (struct in6_ifaddr *)mdc2; - copia = fdm->ia_addr.sin6_addr; - /* need for leaving scope_id in the sock_addr */ - in6_clearscope(&copia); - if (IN6_ARE_ADDR_EQUAL(ip6_addr, &copia)) { - if_addr_runlock(mdc); - return 1; - } - } - } - if_addr_runlock(mdc); - } - return 0; -} - -static int verify_path6(struct in6_addr *src, struct ifnet *ifp, u_int fib) { struct route_in6 ro; @@ -1539,7 +1511,8 @@ do { \ #ifdef INET6 /* FALLTHROUGH */ case O_IP6_SRC_ME: - match= is_ipv6 && search_ip6_addr_net(&args->f_id.src_ip6); + match= is_ipv6 && + in6_localip(&args->f_id.src_ip6); #endif break; @@ -1578,7 +1551,8 @@ do { \ #ifdef INET6 /* FALLTHROUGH */ case O_IP6_DST_ME: - match= is_ipv6 && search_ip6_addr_net(&args->f_id.dst_ip6); + match= is_ipv6 && + in6_localip(&args->f_id.dst_ip6); #endif break;