From owner-svn-src-user@FreeBSD.ORG Thu Feb 7 15:13:35 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]) by hub.freebsd.org (Postfix) with ESMTP id E55B3F39; Thu, 7 Feb 2013 15:13:35 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id B688E747; Thu, 7 Feb 2013 15:13:35 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r17FDZSZ097710; Thu, 7 Feb 2013 15:13:35 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r17FDZQQ097704; Thu, 7 Feb 2013 15:13:35 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201302071513.r17FDZQQ097704@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Thu, 7 Feb 2013 15:13:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r246477 - 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: Thu, 07 Feb 2013 15:13:36 -0000 Author: ae Date: Thu Feb 7 15:13:35 2013 New Revision: 246477 URL: http://svnweb.freebsd.org/changeset/base/246477 Log: Use proper pointer in the ifa_free(). Remove sa6_embedscope/in6_setscope calls. 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 Thu Feb 7 15:11:43 2013 (r246476) +++ user/ae/inet6/sys/netinet6/in6_pcb.c Thu Feb 7 15:13:35 2013 (r246477) @@ -179,11 +179,11 @@ in6_pcbbind(register struct inpcb *inp, */ if (ifa != NULL && ifa->ia6_flags & (IN6_IFF_ANYCAST|IN6_IFF_NOTREADY|IN6_IFF_DETACHED)) { - ifa_free(ifa); + ifa_free(&ifa->ia_ifa); return (EADDRNOTAVAIL); } if (ifa != NULL) - ifa_free(ifa); + ifa_free(&ifa->ia_ifa); } if (lport) { struct inpcb *t; @@ -312,7 +312,6 @@ in6_pcbladdr(register struct inpcb *inp, register struct sockaddr_in6 *sin6 = (struct sockaddr_in6 *)nam; int error = 0; struct ifnet *ifp = NULL; - int scope_ambiguous = 0; struct in6_addr in6a; INP_WLOCK_ASSERT(inp); @@ -324,12 +323,6 @@ in6_pcbladdr(register struct inpcb *inp, return (EAFNOSUPPORT); if (sin6->sin6_port == 0) return (EADDRNOTAVAIL); - - if (sin6->sin6_scope_id == 0 && !V_ip6_use_defzone) - scope_ambiguous = 1; - if ((error = sa6_embedscope(sin6, V_ip6_use_defzone)) != 0) - return(error); - if (!TAILQ_EMPTY(&V_in6_ifaddrhead)) { /* * If the destination address is UNSPECIFIED addr, @@ -338,6 +331,9 @@ in6_pcbladdr(register struct inpcb *inp, if (IN6_IS_ADDR_UNSPECIFIED(&sin6->sin6_addr)) sin6->sin6_addr = in6addr_loopback; } + error = sa6_checkzone(sin6); + if (error != 0) + return (error); if ((error = prison_remote_ip6(inp->inp_cred, &sin6->sin6_addr)) != 0) return (error); @@ -345,12 +341,6 @@ in6_pcbladdr(register struct inpcb *inp, inp, NULL, inp->inp_cred, &ifp, &in6a); if (error) return (error); - - if (ifp && scope_ambiguous && - (error = in6_setscope(&sin6->sin6_addr, ifp, NULL)) != 0) { - return(error); - } - /* * Do not update this earlier, in case we return with an error. * @@ -359,13 +349,11 @@ in6_pcbladdr(register struct inpcb *inp, * Is it the intended behavior? */ *plocal_addr6 = in6a; - /* * Don't do pcblookup call here; return interface in * plocal_addr6 * and exit to caller, that will do the lookup. */ - return (0); }