From owner-svn-src-user@FreeBSD.ORG Fri Oct 18 13:54:58 2013 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id A78B83AD; Fri, 18 Oct 2013 13:54:58 +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 9556622FB; Fri, 18 Oct 2013 13:54:58 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9IDswiu081706; Fri, 18 Oct 2013 13:54:58 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9IDswqp081705; Fri, 18 Oct 2013 13:54:58 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201310181354.r9IDswqp081705@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Fri, 18 Oct 2013 13:54:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r256741 - user/ae/inet6/sys/netinet6 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: Fri, 18 Oct 2013 13:54:58 -0000 Author: ae Date: Fri Oct 18 13:54:58 2013 New Revision: 256741 URL: http://svnweb.freebsd.org/changeset/base/256741 Log: Use in6_getscopezone() instead of in6_setscope() and sa6_embedscope(). Modified: user/ae/inet6/sys/netinet6/in6.c Modified: user/ae/inet6/sys/netinet6/in6.c ============================================================================== --- user/ae/inet6/sys/netinet6/in6.c Fri Oct 18 13:27:34 2013 (r256740) +++ user/ae/inet6/sys/netinet6/in6.c Fri Oct 18 13:54:58 2013 (r256741) @@ -1010,25 +1010,11 @@ in6_update_ifa(struct ifnet *ifp, struct * zone identifier. */ dst6 = ifra->ifra_dstaddr; - if ((ifp->if_flags & (IFF_POINTOPOINT|IFF_LOOPBACK)) != 0 && - (dst6.sin6_family == AF_INET6)) { - struct in6_addr in6_tmp; - u_int32_t zoneid; - - in6_tmp = dst6.sin6_addr; - if (in6_setscope(&in6_tmp, ifp, &zoneid)) - return (EINVAL); /* XXX: should be impossible */ - - if (dst6.sin6_scope_id != 0) { - if (dst6.sin6_scope_id != zoneid) - return (EINVAL); - } else /* user omit to specify the ID. */ - dst6.sin6_scope_id = zoneid; - - /* convert into the internal form */ - if (sa6_embedscope(&dst6, 0)) - return (EINVAL); /* XXX: should be impossible */ - } + if ((ifp->if_flags & (IFF_POINTOPOINT | IFF_LOOPBACK)) != 0 && + dst6.sin6_family == AF_INET6 && dst6.sin6_scope_id != 0 && + dst6.sin6_scope_id != in6_getscopezone(ifp, + in6_addrscope(&dst6.sin6_addr))) + return (EINVAL); /* * The destination address can be specified only for a p2p or a * loopback interface. If specified, the corresponding prefix length