Add scope zone index to host cache. --- sys/netinet/tcp_hostcache.c (svn+ssh://svn.freebsd.org/base/head) (revision 261548) +++ sys/netinet/tcp_hostcache.c (working copy) @@ -296,7 +296,8 @@ tcp_hc_lookup(struct in_conninfo *inc) TAILQ_FOREACH(hc_entry, &hc_head->hch_bucket, rmx_q) { if (inc->inc_flags & INC_ISIPV6) { if (memcmp(&inc->inc6_faddr, &hc_entry->ip6, - sizeof(inc->inc6_faddr)) == 0) + sizeof(inc->inc6_faddr)) == 0 && + hc_entry->ip6_zoneid == inc->inc6_zoneid) return hc_entry; } else { if (memcmp(&inc->inc_faddr, &hc_entry->ip4, @@ -386,9 +387,10 @@ tcp_hc_insert(struct in_conninfo *inc) * Initialize basic information of hostcache entry. */ bzero(hc_entry, sizeof(*hc_entry)); - if (inc->inc_flags & INC_ISIPV6) - bcopy(&inc->inc6_faddr, &hc_entry->ip6, sizeof(hc_entry->ip6)); - else + if (inc->inc_flags & INC_ISIPV6) { + hc_entry->ip6 = inc->inc6_faddr; + hc_entry->ip6_zoneid = inc->inc6_zoneid; + } else hc_entry->ip4 = inc->inc_faddr; hc_entry->rmx_head = hc_head; hc_entry->rmx_expire = V_tcp_hostcache.expire;