Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 17 Aug 2010 17:30:56 +0000 (UTC)
From:      Hajimu UMEMOTO <ume@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r211435 - head/sys/netinet6
Message-ID:  <201008171730.o7HHUu90039599@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: ume
Date: Tue Aug 17 17:30:56 2010
New Revision: 211435
URL: http://svn.freebsd.org/changeset/base/211435

Log:
  Make `ping6 -I' work with net.inet6.ip6.use_defaultzone=1.
  
  MFC after:	2 weeks

Modified:
  head/sys/netinet6/raw_ip6.c

Modified: head/sys/netinet6/raw_ip6.c
==============================================================================
--- head/sys/netinet6/raw_ip6.c	Tue Aug 17 17:11:15 2010	(r211434)
+++ head/sys/netinet6/raw_ip6.c	Tue Aug 17 17:30:56 2010	(r211435)
@@ -401,6 +401,7 @@ rip6_output(m, va_alist)
 	struct ifnet *oifp = NULL;
 	int type = 0, code = 0;		/* for ICMPv6 output statistics only */
 	int scope_ambiguous = 0;
+	int use_defzone = 0;
 	struct in6_addr in6a;
 	va_list ap;
 
@@ -430,9 +431,11 @@ rip6_output(m, va_alist)
 	 * XXX: we may still need to determine the zone later.
 	 */
 	if (!(so->so_state & SS_ISCONNECTED)) {
-		if (dstsock->sin6_scope_id == 0 && !V_ip6_use_defzone)
+		if (!optp->ip6po_pktinfo || !optp->ip6po_pktinfo->ipi6_ifindex)
+			use_defzone = V_ip6_use_defzone;
+		if (dstsock->sin6_scope_id == 0 && !use_defzone)
 			scope_ambiguous = 1;
-		if ((error = sa6_embedscope(dstsock, V_ip6_use_defzone)) != 0)
+		if ((error = sa6_embedscope(dstsock, use_defzone)) != 0)
 			goto bad;
 	}
 



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