Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 19 Apr 2011 08:29:28 +0000 (UTC)
From:      "Bjoern A. Zeeb" <bz@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
Subject:   svn commit: r220825 - stable/8/sys/netinet6
Message-ID:  <201104190829.p3J8TSDG000156@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: bz
Date: Tue Apr 19 08:29:28 2011
New Revision: 220825
URL: http://svn.freebsd.org/changeset/base/220825

Log:
  MFC r220463:
  
   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

Modified:
  stable/8/sys/netinet6/udp6_usrreq.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)

Modified: stable/8/sys/netinet6/udp6_usrreq.c
==============================================================================
--- stable/8/sys/netinet6/udp6_usrreq.c	Tue Apr 19 08:17:36 2011	(r220824)
+++ stable/8/sys/netinet6/udp6_usrreq.c	Tue Apr 19 08:29:28 2011	(r220825)
@@ -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,
@@ -1080,7 +1068,6 @@ udp6_send(struct socket *so, int flags, 
 	mac_inpcb_create_mbuf(inp, m);
 #endif
 	error = udp6_output(inp, m, addr, control, td);
-out:
 	INP_WUNLOCK(inp);
 	INP_INFO_WUNLOCK(&V_udbinfo);
 	return (error);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201104190829.p3J8TSDG000156>