diff options
author | gVisor bot <gvisor-bot@google.com> | 2021-04-06 17:20:52 +0000 |
---|---|---|
committer | gVisor bot <gvisor-bot@google.com> | 2021-04-06 17:20:52 +0000 |
commit | 5f79ea8aa0f229e0f1e69b95b51d4f1c5cd42258 (patch) | |
tree | f396262c0197d75b15dad90600324b810139a202 /pkg/tcpip/network/ipv6 | |
parent | 5951e1a82befe3f9b39fd5f3400b65c494cc438a (diff) | |
parent | d7fd00bad1416fb44b3303331ee223c28c69fe9b (diff) |
Merge release-20210322.0-53-gd7fd00bad (automated)
Diffstat (limited to 'pkg/tcpip/network/ipv6')
-rw-r--r-- | pkg/tcpip/network/ipv6/mld.go | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/pkg/tcpip/network/ipv6/mld.go b/pkg/tcpip/network/ipv6/mld.go index dd153466d..538590baf 100644 --- a/pkg/tcpip/network/ipv6/mld.go +++ b/pkg/tcpip/network/ipv6/mld.go @@ -80,6 +80,25 @@ func (mld *mldState) SendLeave(groupAddress tcpip.Address) tcpip.Error { return err } +// ShouldPerformProtocol implements ip.MulticastGroupProtocol. +func (mld *mldState) ShouldPerformProtocol(groupAddress tcpip.Address) bool { + // As per RFC 2710 section 5 page 10, + // + // The link-scope all-nodes address (FF02::1) is handled as a special + // case. The node starts in Idle Listener state for that address on + // every interface, never transitions to another state, and never sends + // a Report or Done for that address. + // + // MLD messages are never sent for multicast addresses whose scope is 0 + // (reserved) or 1 (node-local). + if groupAddress == header.IPv6AllNodesMulticastAddress { + return false + } + + scope := header.V6MulticastScope(groupAddress) + return scope != header.IPv6Reserved0MulticastScope && scope != header.IPv6InterfaceLocalMulticastScope +} + // init sets up an mldState struct, and is required to be called before using // a new mldState. // @@ -91,7 +110,6 @@ func (mld *mldState) init(ep *endpoint) { Clock: ep.protocol.stack.Clock(), Protocol: mld, MaxUnsolicitedReportDelay: UnsolicitedReportIntervalMax, - AllNodesAddress: header.IPv6AllNodesMulticastAddress, }) } |