From owner-svn-src-user@FreeBSD.ORG Tue Oct 15 08:20:21 2013 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id D16766ED; Tue, 15 Oct 2013 08:20:21 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id A559F2BDA; Tue, 15 Oct 2013 08:20:21 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9F8KL5U024273; Tue, 15 Oct 2013 08:20:21 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9F8KLD5024265; Tue, 15 Oct 2013 08:20:21 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201310150820.r9F8KLD5024265@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Tue, 15 Oct 2013 08:20:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r256508 - user/ae/inet6/sys/netinet X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Oct 2013 08:20:21 -0000 Author: ae Date: Tue Oct 15 08:20:20 2013 New Revision: 256508 URL: http://svnweb.freebsd.org/changeset/base/256508 Log: It is possible, that many remote hosts have equal link-local addresses, but from different scope zones. Thus, they can have different tcp-specific metrics. Add ip6_zoneid field in addition to ip6 address to hc_metrics structure to be able handle this case. Modified: user/ae/inet6/sys/netinet/tcp_hostcache.c user/ae/inet6/sys/netinet/tcp_hostcache.h Modified: user/ae/inet6/sys/netinet/tcp_hostcache.c ============================================================================== --- user/ae/inet6/sys/netinet/tcp_hostcache.c Tue Oct 15 08:04:25 2013 (r256507) +++ user/ae/inet6/sys/netinet/tcp_hostcache.c Tue Oct 15 08:20:20 2013 (r256508) @@ -295,7 +295,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, @@ -385,9 +386,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; Modified: user/ae/inet6/sys/netinet/tcp_hostcache.h ============================================================================== --- user/ae/inet6/sys/netinet/tcp_hostcache.h Tue Oct 15 08:04:25 2013 (r256507) +++ user/ae/inet6/sys/netinet/tcp_hostcache.h Tue Oct 15 08:20:20 2013 (r256508) @@ -51,6 +51,7 @@ struct hc_metrics { struct hc_head *rmx_head; /* head of bucket tail queue */ struct in_addr ip4; /* IP address */ struct in6_addr ip6; /* IP6 address */ + uint32_t ip6_zoneid; /* IPv6 scope zone id */ /* endpoint specific values for tcp */ u_long rmx_mtu; /* MTU for this path */ u_long rmx_ssthresh; /* outbound gateway buffer limit */