summaryrefslogtreecommitdiffstats
path: root/sys/netinet6/mld6.c
diff options
context:
space:
mode:
authorbms <bms@FreeBSD.org>2010-04-10 12:24:21 +0000
committerbms <bms@FreeBSD.org>2010-04-10 12:24:21 +0000
commit530b2e634f8a856a4c982125f3ac2a7ed8d80a7a (patch)
treedc1cc55346bc3818e2eff891704ef0302a604d17 /sys/netinet6/mld6.c
parent1ffd57013806fa37b72b99619d53d742378cd0ba (diff)
downloadFreeBSD-src-530b2e634f8a856a4c982125f3ac2a7ed8d80a7a.zip
FreeBSD-src-530b2e634f8a856a4c982125f3ac2a7ed8d80a7a.tar.gz
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
Diffstat (limited to 'sys/netinet6/mld6.c')
-rw-r--r--sys/netinet6/mld6.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/sys/netinet6/mld6.c b/sys/netinet6/mld6.c
index cade0d2..21d9eab 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.
OpenPOWER on IntegriCloud