From owner-svn-src-head@FreeBSD.ORG Sat Apr 9 02:22:49 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E838D106564A; Sat, 9 Apr 2011 02:22:49 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A02C08FC0A; Sat, 9 Apr 2011 02:22:49 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p392Mnn2097985; Sat, 9 Apr 2011 02:22:49 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p392MnJ1097983; Sat, 9 Apr 2011 02:22:49 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201104090222.p392MnJ1097983@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Sat, 9 Apr 2011 02:22:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r220463 - head/sys/netinet6 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Apr 2011 02:22:50 -0000 Author: bz Date: Sat Apr 9 02:22:49 2011 New Revision: 220463 URL: http://svn.freebsd.org/changeset/base/220463 Log: Remove a check in udp6_send() that prevented v4-mapped v6 addresses from working. We store v4 and v6 addresses as a union but for v4-mapped addresses only store the 32bits w/o the ::ffff: word. That failed the check as for example 127.0.0.1 would be ::7f00:1 rather than ::ffff:7f00:1 and the IN6_IS_ADDR_V4MAPPED() never worked here. Given we can hardly get here with an unbound local address or invalid inp_vflags remove the check. Reported by: tuexen Reviewed by: tuexen MFC after: 3 days Modified: head/sys/netinet6/udp6_usrreq.c Modified: head/sys/netinet6/udp6_usrreq.c ============================================================================== --- head/sys/netinet6/udp6_usrreq.c Sat Apr 9 01:29:46 2011 (r220462) +++ head/sys/netinet6/udp6_usrreq.c Sat Apr 9 02:22:49 2011 (r220463) @@ -1045,18 +1045,6 @@ udp6_send(struct socket *so, int flags, if (hasv4addr) { struct pr_usrreqs *pru; - if (!IN6_IS_ADDR_UNSPECIFIED(&inp->in6p_laddr) && - !IN6_IS_ADDR_V4MAPPED(&inp->in6p_laddr)) { - /* - * When remote addr is IPv4-mapped address, - * local addr should not be an IPv6 address; - * since you cannot determine how to map IPv6 - * source address to IPv4. - */ - error = EINVAL; - goto out; - } - /* * XXXRW: We release UDP-layer locks before calling * udp_send() in order to avoid recursion. However, @@ -1081,7 +1069,6 @@ udp6_send(struct socket *so, int flags, #endif error = udp6_output(inp, m, addr, control, td); #ifdef INET -out: #endif INP_WUNLOCK(inp); INP_INFO_WUNLOCK(&V_udbinfo);