From e1fbf7b34c0e9db6c6845238bc553fc470857fef Mon Sep 17 00:00:00 2001 From: Adam Ierymenko Date: Wed, 28 Sep 2016 12:21:08 -0700 Subject: [PATCH] Check multicast limit on send after NDP emulation code. --- node/Switch.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/node/Switch.cpp b/node/Switch.cpp index 6611d6b6f..75898d219 100644 --- a/node/Switch.cpp +++ b/node/Switch.cpp @@ -349,11 +349,6 @@ void Switch::onLocalEthernet(const SharedPtr &network,const MAC &from,c } if (to.isMulticast()) { - if (network->config().multicastLimit == 0) { - TRACE("%.16llx: dropped multicast: not allowed on network",network->id()); - return; - } - MulticastGroup multicastGroup(to,0); if (to.isBroadcast()) { @@ -457,6 +452,12 @@ void Switch::onLocalEthernet(const SharedPtr &network,const MAC &from,c } // else no NDP emulation } + // Check this after NDP emulation, since that has to be allowed in exactly this case + if (network->config().multicastLimit == 0) { + TRACE("%.16llx: dropped multicast: not allowed on network",network->id()); + return; + } + /* Learn multicast groups for bridged-in hosts. * Note that some OSes, most notably Linux, do this for you by learning * multicast addresses on bridge interfaces and subscribing each slave.