From 300cdd3c94d10f3e06bc22f78385b446ea581232 Mon Sep 17 00:00:00 2001 From: Bruce M Simpson Date: Tue, 27 Apr 2010 13:27:51 +0000 Subject: [PATCH] MFC 206454: 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 --- sys/netinet6/mld6.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/sys/netinet6/mld6.c b/sys/netinet6/mld6.c index cade0d2b208..21d9eabe363 100644 --- a/sys/netinet6/mld6.c +++ b/sys/netinet6/mld6.c @@ -195,8 +195,10 @@ static int sysctl_mld_ifinfo(SYSCTL_HANDLER_ARGS); 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.