From owner-svn-src-user@FreeBSD.ORG Mon Dec 23 22:00:38 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 ESMTPS id B93DCD03; Mon, 23 Dec 2013 22:00:38 +0000 (UTC) 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 8C1E51331; Mon, 23 Dec 2013 22:00:38 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBNM0cZD065686; Mon, 23 Dec 2013 22:00:38 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBNM0cYJ065685; Mon, 23 Dec 2013 22:00:38 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201312232200.rBNM0cYJ065685@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Mon, 23 Dec 2013 22:00:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r259793 - 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.17 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: Mon, 23 Dec 2013 22:00:38 -0000 Author: ae Date: Mon Dec 23 22:00:38 2013 New Revision: 259793 URL: http://svnweb.freebsd.org/changeset/base/259793 Log: Use updated prison_xxx_ip6() functions with sockaddr_in6 argument. Modified: user/ae/inet6/sys/netinet6/in6_pcb.c Modified: user/ae/inet6/sys/netinet6/in6_pcb.c ============================================================================== --- user/ae/inet6/sys/netinet6/in6_pcb.c Mon Dec 23 21:58:03 2013 (r259792) +++ user/ae/inet6/sys/netinet6/in6_pcb.c Mon Dec 23 22:00:38 2013 (r259793) @@ -128,9 +128,16 @@ in6_pcbbind(struct inpcb *inp, struct so if ((so->so_options & (SO_REUSEADDR|SO_REUSEPORT)) == 0) lookupflags = INPLOOKUP_WILDCARD; if (nam == NULL) { - if ((error = prison_local_ip6(cred, &inp->in6p_laddr, - ((inp->inp_flags & IN6P_IPV6_V6ONLY) != 0))) != 0) + struct sockaddr_in6 tmp; + + tmp = sa6_any; + error = prison_local_ip6(cred, &tmp, + ((inp->inp_flags & IN6P_IPV6_V6ONLY) != 0)); + if (error != 0) return (error); + inp->in6p_laddr = tmp.sin6_addr; + if (IN6_IS_ADDR_LINKLOCAL(&inp->in6p_laddr)) + inp->in6p_zoneid = tmp.sin6_scope_id; } else { sin6 = (struct sockaddr_in6 *)nam; if (nam->sa_len != sizeof(*sin6)) @@ -142,7 +149,7 @@ in6_pcbbind(struct inpcb *inp, struct so inp->in6p_moptions, sin6)) != 0) return (error); - if ((error = prison_local_ip6(cred, &sin6->sin6_addr, + if ((error = prison_local_ip6(cred, sin6, ((inp->inp_flags & IN6P_IPV6_V6ONLY) != 0))) != 0) return (error); @@ -328,7 +335,7 @@ in6_pcbconnect_mbuf(register struct inpc inp->in6p_moptions, sin6); if (error != 0) return (error); - if ((error = prison_remote_ip6(inp->inp_cred, &sin6->sin6_addr)) != 0) + if ((error = prison_remote_ip6(inp->inp_cred, sin6)) != 0) return (error); /* * Determine source address and outgoing interface. @@ -884,8 +891,8 @@ in6_pcblookup_group(struct inpcbinfo *pc injail = prison_flag(inp->inp_cred, PR_IP6); if (injail) { - if (prison_check_ip6(inp->inp_cred, - laddr) != 0) + if (prison_check_in6(inp->inp_cred, + laddr, zoneid) != 0) continue; } else { if (local_exact != NULL) @@ -1024,8 +1031,8 @@ in6_pcblookup_hash_locked(struct inpcbin injail = prison_flag(inp->inp_cred, PR_IP6); if (injail) { - if (prison_check_ip6(inp->inp_cred, - laddr) != 0) + if (prison_check_in6(inp->inp_cred, + laddr, zoneid) != 0) continue; } else { if (local_exact != NULL)