Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 10 Apr 2010 12:24:21 +0000 (UTC)
From:      Bruce M Simpson <bms@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r206454 - head/sys/netinet6
Message-ID:  <201004101224.o3ACOLfH078586@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: bms
Date: Sat Apr 10 12:24:21 2010
New Revision: 206454
URL: http://svn.freebsd.org/changeset/base/206454

Log:
  When embedding the scope ID in MLDv1 output, check if the scope of the address
  being embedded is in fact link-local, before attempting to embed it.
  
  Note that this operation is a side-effect of trying to avoid recursion on
  the IN6 scope lock.
  
  PR:		144560
  Submitted by:	Petr Lampa
  MFC after:	3 days

Modified:
  head/sys/netinet6/mld6.c

Modified: head/sys/netinet6/mld6.c
==============================================================================
--- head/sys/netinet6/mld6.c	Sat Apr 10 12:10:11 2010	(r206453)
+++ head/sys/netinet6/mld6.c	Sat Apr 10 12:24:21 2010	(r206454)
@@ -195,8 +195,10 @@ static int	sysctl_mld_ifinfo(SYSCTL_HAND
 static struct mtx		 mld_mtx;
 MALLOC_DEFINE(M_MLD, "mld", "mld state");
 
-#define	MLD_EMBEDSCOPE(pin6, zoneid) \
-	(pin6)->s6_addr16[1] = htons((zoneid) & 0xFFFF)
+#define	MLD_EMBEDSCOPE(pin6, zoneid)					\
+	if (IN6_IS_SCOPE_LINKLOCAL(pin6) ||				\
+	    IN6_IS_ADDR_MC_INTFACELOCAL(pin6))				\
+		(pin6)->s6_addr16[1] = htons((zoneid) & 0xFFFF)		\
 
 /*
  * VIMAGE-wide globals.



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